3 email = gitcommit@henk.geekmail.org
6 # always make new branches rebase on their tracking branch
7 autosetuprebase = always
9 # use (i)ndex, (w)orktree, (c)ommit, etc instead of a/ and b/
11 # detect renames and copies
13 # use different color for moved code (default == zebra, currently)
16 # delete tracking references and info about remote branches
17 # does not delete any branches
20 # show linenumber (-n)
23 # only do fastforward merges
26 # push to branch with same name on remote
29 # rebase, don’t merge, local changes
31 # only accept fastforwards by default
34 # when in a dirty worktree, automatically create a stash before and apply after rebasing
36 # automatically squash marked commits (squash! …, fixup! …)
39 # don’t use rerere to resolve merge conflicts
45 ai = add --interactive
55 cpa = cherry-pick --abort
56 cpc = cherry-pick --continue
61 cmv = commit --all --verbose
63 amend = commit --amend
64 caa = commit --all --amend --reuse-message=HEAD
65 fix = commit --all --fixup
67 diff = diff --word-diff
70 dlc = diff --cached HEAD^
71 dr = "!f() { git diff -w "$1"^.."$1"; }; f"
72 diffr = "!f() { git diff "$1"^.."$1"; }; f"
77 ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date = relative
78 ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
79 lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
82 lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
83 lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all
85 taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
91 please = push --force-with-lease
97 rbc = rebase --continue
103 rh1 = reset --hard HEAD^
104 rh2 = reset --hard HEAD^^
114 f = "!git ls-files | grep -i"
115 lc = "!f() { git ll "$1"^.."$1"; }; f"
118 svnl = svn log --oneline --show-commit
119 assume = update-index --assume-unchanged
120 unassume = update-index --no-assume-unchanged
122 assumed = "!git ls-files -v | grep ^h | cut -c 3-"
123 # unassume all the assumed files
124 unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
125 assumeall = "!git status -s | awk {'print $2'} | xargs git assume"
127 sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
129 sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
131 lasttag = "describe --tags --abbrev=0"
132 lt = "describe --tags --abbrev=0"
135 ours = "!f() { git co --ours $@ && git add $@; }; f"
136 theirs = "!f() { git co --theirs $@ && git add $@; }; f"
139 rem="!git config -l | grep remote.*url | tail -n +2"
141 #apply patch from other local repo
142 lap = "!f() { git --git-dir=$1 format-patch -k -1 --stdout $2 | git am -3 -k; }; f"
144 #open markdown files edited in last commit
145 last = "!gvim $(git show HEAD --format="" --name-only | grep -e .*md$ | xargs)"
146 #open just created markdown in working directory
147 newmd = "!gvim $(git status -s | awk {'print $2'})"
149 # initial empty commit
150 empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
153 la = "!git config -l | grep alias | cut -c 7-"
154 # grep from root folder
155 gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f"
156 #rename branch tree to done-
157 done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
158 #add bitbucket remote
159 ra = "!f() { git remote add $1 https://bitbucket.org/$2.git; }; f"
161 # undo from here http://megakemp.com/2016/08/25/git-undo/
162 undo = "!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f"
163 serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git