Update fzf location
[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 pulled-changes = !git log -p -2
13 not-yet-pulled = !git log --name-status origin/master
14 lastco = log -1 HEAD --numstat
15 last-diff = !git diff HEAD^ HEAD
16
17 # undoing things
18 undo-commit = reset --soft HEAD^
19 undo-add = reset HEAD
20 undo-modif = checkout
21 undo-merge-conflict-fix = reset --hard
22 # abort-merge = reset --hard HEAD
23 abort-merge = merge --abort
24 unassume-unch = update-index --no-assume-unchanged
25 list-assumed-unch = "!git ls-files -v | grep ^[a-z]"
26 unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
27 drop-all-modifs = "!git checkout -- ."
28
29 # branches
30 current-branch = rev-parse --abbrev-ref HEAD
31 create-branch-from-stash = !git stash branch
32 create-branch = checkout -b
33 rename-branch = branch -m
34 goto-branch = checkout
35 delete-local-branch = branch -d
36 delete-remote-branch = push origin --delete
37
38 assume-unch = update-index --assume-unchanged
39 list-assumed-unch = !git ls-files -v | grep "^[[:lower:]]"
40 assumeall = "!git st -s | awk {'print $2'} | xargs git assume-unch"
41
42 fixme = grep --heading --break --ignore-case -e 'FIX: *' -e 'FIXME: *'
43 todo = grep --heading --break --ignore-case -e 'TODO: *'
44
45 fix-latest-commit = commit --amend
46 panic = !tar cvf ../git_panic.tar *
47 current-branch = rev-parse --symbolic-full-name --abbrev-ref HEAD
48 number-of-commits-since-master = "! sh -c 'git log master..`git current-branch` --oneline | wc -l | tr -d \" \"'"
49 std = "! sh -c 'git status -s | while read mode file; do echo $mode $file $(stat -c %y $file); done'"
50
51 up = !git pull --rebase
52 ec = config --global -e
53 cl = clone
54 ct = checkout
55 co = commit
56 #cos = commit --gpg-sign=7C8BEEE4613F8484
57 cos = commit -S
58 cov = commit --verbose
59 #covs = commit --gpg-sign=7C8BEEE4613F8484 --verbose
60 covs = commit -S --verbose
61 com = commit -m
62 #coms = commit --gpg-sign=7C8BEEE4613F8484 -m
63 coms = commit -S -m
64 st = status
65 sts = status -s
66 stu = status -uno
67 dma= !git checkout -- .
68 br = branch
69 dc = diff --cached
70 au = add -u
71 cp = cherry-pick
72 hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
73 type = cat-file -t
74 dump = cat-file -p
75 stash = stash save -u # stash even the untracked files, and add a clear message
76 count-commit = rev-list --count
77 # log
78 compactlog = log --pretty=format:"%Cgreen%h%Creset%x09%Cred%an%Creset%x09%ad%x09%s" --date=short
79 ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
80 ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
81 ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
82 log-diffs = log -u
83 log-me = !UN=$(git config user.name)&& git ld --author="\"$UN\""
84 lol = log --graph --decorate --pretty=oneline --abbrev-commit
85 lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
86 show-history ="!git log -p "
87
88 # reset
89 r = reset
90 r1 = reset HEAD^
91 r2 = reset HEAD^^
92 rh = reset --hard
93 rh1 = reset HEAD^ --hard
94 rh2 = reset HEAD^^ --hard
95
96 # how to pass params to git aliases
97 my-alias1 = "!f(){ echo \"$@\"; }; f" # define a func, then call the func.
98 my-alias2 = "! date " # call the cmd directly
99 log-remote = "!git log HEAD..origin"
100
101 # check if file is tracked
102 is-tracked = "!t(){ git ls-files $1 --error-unmatch; echo $?; }; t"
103 back = "!f(){git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}};}; f"
104
105 # add to last commit file that are actually staged
106 commend = commit --amend --no-edit
107 commend-edit = commit --amend -S
108 it = !git init && git commit -m \"root\" --allow-empty
109
110 # always create a merge commit when merging branches
111 merc = merge --no-ff
112 dfw = diff --ignore-space-change
113 changes = diff --name-status -r
114 diffstat = diff --stat -r
115 filepath = "!git ls-files | grep -i"
116
117 # aliases I've never used
118 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
119 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
120 lg = !"git lg1"
121 parent-branch = !"git show-branch -a | ack '\\*' | ack -v \"`git current-branch`\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//'"
122
123
124 [color]
125 ui = always
126 branch = auto
127 diff = auto
128 interactive = auto
129 status = auto
130
131 [commit]
132 template = /home/nsukami/.gitcommitmessagetemplate.txt
133
134
135 [status]
136 # be careful with that one
137 # showUntrackedFiles = all
138 [push]
139 # git push branch I'm currently on
140 default = matching
141
142 [init]
143 templatedir = ~/.git_template
144
145 [merge]
146 tool = emerge
147
148 [github]
149 user = lemeteore
150
151 [include]
152 path = ~/.gitconfig.local
153
154 [rerere]
155 # "reuse recorded resolution"
156 # it will record how you solved previous conflicts
157 # next time it finds the same conflict it will just apply your previous fix.
158 enabled = true
159
160 [gpg]
161 program = "/usr/bin/gpg"
162 [pull]
163 # git pull --rebase by default
164 rebase = true
165 [branch]
166 # This will ensure that whether you checkout a remote branch,
167 # or create a new one; the tracking information will be handled
168 # automatically by git. Then you will be able to
169
170 # git clone <some_repo>
171 # git checkout -b <new_branch>
172 # git push
173 # git pull
174 autoSetupMerge = always