bd = branch -d
co = checkout
cb = checkout -b
- ca = commit --amend
- cm = commit -a --amend -C HEAD
ci = commit -v
- ca = commit -a -v
- dc = diff --cached
+ ca = commit -av --amend
+ cm = commit -a --amend -C HEAD
df = diff
dt = difftool
- me = merge
+ dc = diff --cached
+ mg = merge
mt = mergetool
st = status --short --branch
- tg = tag -a
- tags = tag -l
+ tg = tag -l
pu = push --tags
+ pl = pull --rebase
ed = config --global -e
+ ls = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
- ld = log --pretty=format:"%C(yellow)%h\\ %C(green)%ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short --graph
- ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
- lg = log --all --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
- last = log -1 HEAD
+ tail = !"git ls -10 HEAD"
+ last = !"git ll -1 HEAD"
type = cat-file -t
dump = cat-file -p
who = shortlog -s --
+ remotes = remote -v
+ root = rev-parse --show-toplevel
+# go branch
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
+ # rebase branch
reb = "!r() { git rebase -i HEAD~$1; }; r"
-
+ # delete branch
+ dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
+
#un = reset --hard HEAD
#uh = reset --hard HEAD^
uncommit = reset --soft HEAD~1
discard = checkout --
cl = clone --recursive
- branches = branch -a
- remotes = remote -v
-
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
- # Credit an author on the latest commit
- credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
-
# Find branches containing commit
fb = "!f() { git branch -a --contains $1; }; f"
# Find tags containing commit
# Find commits by commit message
fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
- # Remove branches that have already been merged with master
- # a.k.a. ?delete merged?
- dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
+# Credit an author on the latest commit
+ credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
# List contributors with number of commits
contributors = shortlog --summary --numbered
- root = rev-parse --show-toplevel
+
k = !gitk
ctags = "!sh -c '[ -f .git/hooks/ctags ] || git init; .git/hooks/ctags' git-ctags"
grep = auto
[github]
user = jannikz
+[branch "master"]
+ rebase = true
[branch]
autosetupmerge = always
autosetuprebase = always