Git config file

Richard's aliases.

[alias]
        autocommit = commit -av -m "Autocommit" --edit
        br = branch
        cm = commit -v
        co = checkout
        di = diff
        dic = diff --word-diff=color
        dis = !git --no-pager diff --stat
        diff-latex = difftool -t latex
        log1 = log --oneline --graph --decorate
        log1np = !git --no-pager log --oneline --graph --decorate
        st = status
[diff]
#       wordRegex = [^[:space:]]+  # default is something like this.
        wordRegex = [a-zA-Z0-9_]+|[^[:space:]]
[color]
        ui = auto
[difftool "latex"]
        cmd = git-latexdiff \"$LOCAL\" \"$REMOTE\"

Pushing into a live branch

Sometimes you want to use git to update a "working copy", for example, pushing to a server to update the main website. You can not push to a checked out branch (well, you can, but that would involve overwriting local changes and other issues...). Instead, we use an "incoming" branch to push to, and merge that to the live branch using a post-receive hook. In the system below, push to the INCOMING_BRANCH, and each push will: merge INCOMING_BRANCH into LIVE_BRANCH, and then run whatever commands you put at the bottom to make it live.

vi .git/post-receive
chmod a+x .git/post-receive

#set -x                                                                         
INCOMING_BRANCH=new
LIVE_BRANCH=live   # if we want  to make sure we are on the "live" branch
#git checkout live     # if we want  to make sure we are on the "live" branch
cd .. ; unset GIT_DIR
if [ "`cat .git/HEAD`" = "ref: refs/heads/$LIVE_BRANCH" ] ; then
    #echo "Merging into live branch"                                            
    git merge $INCOMING_BRANCH
fi

# Enter your commands to update main below                                      
make

filter-branch

DebianNotes/git (last edited 2017-01-19 16:15:27 by 130)