-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
76 lines (62 loc) · 1.83 KB
/
.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[user]
name = Akshay Patel
email = [email protected]
signingkey = B3C09CF8F65DC094
[core]
excludesfile = ~/.gitignore
pager = cat
whitespace = space-before-tab,trailing-space
[color]
ui = always
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
commit = green bold
frag = magenta bold
old = red bold reverse white
new = green bold reverse
whitespace = red reverse
[color "status"]
added = yellow
changed = green
untracked = cyan
[merge]
log = true
[push]
default = simple
[alias]
sortdiff = !sh -c 'git diff "$@" | grep "^[+-]" | sort --key=1.2 | uniq -u -s1'
# Log PR number for commit
logpr = !sh -c 'git log --reverse --grep=\"Merge pull request\" -n 1 \
--ancestry-path master ^$1 $@' -
# Switch to a branch, creating it if necessary
go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
# Show commit tree view
tree = "log --graph --pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset'"
# Merge GitHub pull request on top of the `master` branch
mpr = "!f() { \
if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
git fetch origin refs/pull/$1/head:pr/$1 && \
git rebase master pr/$1 && \
git checkout master && \
git merge pr/$1 && \
git branch -D pr/$1 && \
git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
fi \
}; f"
# Tree log
lst = !sh -c 'git log --graph --oneline --all'
[branch]
autosetuprebase = always
[pager]
diff = diff-so-fancy
show = diff-so-fancy
[url "[email protected]:"]
insteadOf = https://github.com/
[commit]
gpgsign = true
[help]
autocorrect = 1