-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
124 lines (104 loc) · 3.55 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
[include]
path = ~/git/perso/.gitconfig_ext
[core]
editor = nano
pager = diff-so-fancy | less --tabs=2
excludesfile = ~/.gitignore_global
[color]
diff = auto
status = auto
branch = auto
ui = true
[push]
default = current
[pull]
default = current
[fetch]
prune = true
[alias]
git = !exec git
aliases = "!git config -l | grep alias | cut -c 7-"
a = add
aa = add .
addalltoprevcommit = commit -a --amend -C HEAD
fu = fetch upstream
fa = fetch --all
fp = fetch --prune
p = pull
pr = pull --rebase
prb = pull --rebase
prp = pull --rebase=preserve
prod = pull --rebase origin dev
prom = pull --rebase origin master
st = status -su
stc = !git -c color.status=always status -su
stn = !git stc | nl -ba -s' '
stw = !watch -c -t -n1 "git stc"
co = checkout
zco = "!f() { git checkout $(git bls \"$@\"|grep -v '^*'|fzf|awk '{print $1}'); }; f"
rud = rebase upstream/devel
po = push origin
cob = checkout -b
br = branch
b = branch -vv
brd = branch -D
cp = cherry-pick
bra = "!f(){ git fetch; git branch -a; };f"
rc = rebase --continue
continue = rebase --continue
cont = rebase --continue
abort = rebase --abort
skip = rebase --skip
rbi = rebase -i
rsm = !git stash && git pull --rebase origin master && git stash pop
rsd = !git stash && git pull --rebase origin dev && git stash pop
chg = diff --name-status
changes = "!git log --name-status HEAD.."
parentbranch = !"git show-branch -a 2> /dev/null | grep '\\*' | grep -v \"`git rev-parse --abbrev-ref HEAD`\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//'"
unpushedbranches = "log --branches --not --remotes --simplify-by-decoration --decorate --oneline"
ignored = !git ls-files -v|grep --color '^h'
ci = commit
cm = "!f(){ git commit -m \"${@}\"; };f"
cmn = "!f(){ git commit --no-verify -m \"${@}\"; };f"
sq = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"
amend = commit --amend
ammend = commit --amend
oops = commit --amend --no-edit --no-verify
pu = push -u
pn = push --no-verify
pf = push --force-with-lease
pfn = push --no-verify --force-with-lease
pnf = push --no-verify --force-with-lease
dl = diff --stat
d = diff --unified=0 --ignore-space-at-eol --color-words='[[:alnum:]]+|[^[:space:]]'
df = diff
dc = diff --cached
undolastcommitandkeep = reset --soft HEAD^1
undoall = reset --hard HEAD
lg = log --graph --oneline --decorate --all --color
lgn = log --graph --oneline --decorate --all --color --name-status
hist = log --pretty=oneline --abbrev-commit --graph --decorate
histo = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short --decorate
fire = "!git add -A && git commit --no-verify -m 'This is a fire alert push by @pma. DO NOT delete this branch.' && git push --no-verify origin fire-alert-branch"
willpull = log --stat --pretty="" HEAD..upstream
willrebase = log --stat --pretty="" HEAD..upstream/master
fl = log -u
ls = log --pretty=format:"%n\\ %h\\ %C(red)%ad\\ -\\ %ar\\ %C(yellow)%s%Creset\\ [%an/%cn]" --decorate --stat --date=short
ll = log --pretty=format:"%ad\\ %s" --date=short
f = "!f(){ git ls-files | fzf }f"
[icdiff]
options = --highlight --line-numbers
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = yellow
frag = magenta bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse
[credential]
helper = cache --timeout=2628000