git parent branch alias
[dotfiles] / .gitconfig
1 [user]
2 name = patrick nsukami
3 email = ndkpatt@gmail.com
4
5 [core]
6 excludesfile = /home/nsukami/.gitignore
7 editor = emacs -nw
8 autocrlf = input
9
10 [alias]
11 aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
12
13 current-branch = rev-parse --abbrev-ref HEAD
14 parent-branch = !"git show-branch -a | ack '\\*' | ack -v \"`git current-branch`\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//'"
15
16 pulled-changes = !git log -p -2
17 not-yet-pulled = !git log --name-status origin/master
18 lastco = log -1 HEAD --numstat
19
20 lol = log --graph --decorate --pretty=oneline --abbrev-commit
21 lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
22 lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
23 lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
24 lg = !"git lg1"
25
26 undo-commit = reset --soft HEAD^
27 undo-add = reset HEAD
28 undo-modif = checkout
29 abort-merge = reset --hard HEAD
30 assume-unch = update-index --assume-unchanged
31 unassume-unch = update-index --no-assume-unchanged
32 list-assumed-unch = !git ls-files -v | grep "^[[:lower:]]"
33 unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
34 assumeall = "!git st -s | awk {'print $2'} | xargs git assume-unch"
35
36 create-branch-from-stash = !git stash branch
37 create-branch = checkout -b
38 rename-branch = branch -m
39 goto-branch = checkout
40 delete-local-branch = branch -d
41
42 fix-latest-commit = commit --amend
43 panic = !tar cvf ../git_panic.tar *
44 current-branch = rev-parse --symbolic-full-name --abbrev-ref HEAD
45 number-of-commits-since-master = "! sh -c 'git log master..`git current-branch` --oneline | wc -l | tr -d \" \"'"
46 std = "! sh -c 'git status -s | while read mode file; do echo $mode $file $(stat -c %y $file); done'"
47
48 up = !git pull --rebase
49 ec = config --global -e
50 cl = clone
51 ct = checkout
52 co = commit
53 cov = commit --verbose
54 com = commit -m
55 st = status
56 sts = status -s
57 stu = status -uno
58 br = branch
59 dc = diff --cached
60 au = add -u
61 cp = cherry-pick
62 hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
63 type = cat-file -t
64 dump = cat-file -p
65 stash = stash save -u # stash even the untracked files, and add a clear message
66
67 compactlog = log --pretty=format:"%Cgreen%h%Creset%x09%Cred%an%Creset%x09%ad%x09%s" --date=short
68 ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
69 ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
70 ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
71 log-diffs = log -u
72 log-me = !UN=$(git config user.name)&& git ld --author="\"$UN\""
73
74 filepath = "!git ls-files | grep -i"
75
76 r = reset
77 r1 = reset HEAD^
78 r2 = reset HEAD^^
79 rh = reset --hard
80 rh1 = reset HEAD^ --hard
81 rh2 = reset HEAD^^ --hard
82
83 # how to pass params to git aliases
84 my-alias1 = "!f(){ echo \"$@\"; }; f" # define a func, then call the func.
85 my-alias2 = "! date " # call the cmd directly
86 log-remote = "!git log HEAD..origin"
87
88 [color]
89 ui = always
90 branch = auto
91 diff = auto
92 interactive = auto
93 status = auto
94
95 [commit]
96 template = /home/nsukami/.gitcommitmessagetemplate.txt
97
98 [status]
99 # be careful with that one
100 # showUntrackedFiles = all
101 [push]
102 default = simple