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 a lot of info by default
23 # show linenumber (-n)
26 # only do fastforward merges
29 # push to branch with same name on remote
32 # rebase, don’t merge, local changes
34 # only accept fastforwards by default
37 # when in a dirty worktree, automatically create a stash before and apply after rebasing
39 # automatically squash marked commits (squash! …, fixup! …)
42 # don’t use rerere to resolve merge conflicts
48 ai = add --interactive
58 cpa = cherry-pick --abort
59 cpc = cherry-pick --continue
64 cmv = commit --all --verbose
66 amend = commit --amend
67 caa = commit --all --amend --reuse-message=HEAD
68 fix = commit --all --fixup
70 diff = diff --word-diff
73 dlc = diff --cached HEAD^
74 dr = "!f() { git diff -w "$1"^.."$1"; }; f"
75 diffr = "!f() { git diff "$1"^.."$1"; }; f"
80 ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date = relative
81 ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
82 lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
85 lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
86 lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all
88 taglog = "log --tags --simplify-by-decoration --pretty='format:%ci %d'"
94 please = push --force-with-lease
100 rbc = rebase --continue
106 rh1 = reset --hard HEAD^
107 rh2 = reset --hard HEAD^^
120 f = "!git ls-files | grep -i"
121 lc = "!f() { git ll "$1"^.."$1"; }; f"
124 svnl = svn log --oneline --show-commit
125 assume = update-index --assume-unchanged
126 unassume = update-index --no-assume-unchanged
128 assumed = "!git ls-files -v | grep ^h | cut -c 3-"
129 # unassume all the assumed files
130 unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
131 assumeall = "!git status -s | awk {'print $2'} | xargs git assume"
133 sba = "!f() { git subtree add --prefix $2 $1 master --squash; }; f"
135 sbu = "!f() { git subtree pull --prefix $2 $1 master --squash; }; f"
137 lasttag = "describe --tags --abbrev=0"
138 lt = "describe --tags --abbrev=0"
141 ours = "!f() { git co --ours $@ && git add $@; }; f"
142 theirs = "!f() { git co --theirs $@ && git add $@; }; f"
145 rem="!git config -l | grep remote.*url | tail -n +2"
147 #apply patch from other local repo
148 lap = "!f() { git --git-dir=$1 format-patch -k -1 --stdout $2 | git am -3 -k; }; f"
150 #open markdown files edited in last commit
151 last = "!gvim $(git show HEAD --format="" --name-only | grep -e .*md$ | xargs)"
152 #open just created markdown in working directory
153 newmd = "!gvim $(git status -s | awk {'print $2'})"
155 # initial empty commit
156 empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"
159 la = "!git config -l | grep alias | cut -c 7-"
160 # grep from root folder
161 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"
162 #rename branch tree to done-
163 done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f"
164 #add bitbucket remote
165 ra = "!f() { git remote add $1 https://bitbucket.org/$2.git; }; f"
167 # undo from here http://megakemp.com/2016/08/25/git-undo/
168 undo = "!f() { git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f"
169 serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git