-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgitconfig
138 lines (113 loc) · 4.02 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
125
126
127
128
129
130
131
132
133
134
135
136
137
# vim: ft=gitconfig :
[init]
defaultBranch = main
[color]
diff = auto
status = auto
branch = auto
ui = auto
interactive = auto
[alias]
# Essential
st = status
ci = commit --verbose
pms = commit -a -m 'Draft: POOR MAN STASH'
co = checkout
df = diff
dc = diff --cached
unstash = stash pop
cp = cherry-pick
sts = status --ignore-submodules
br = branches
# Seeing logs
lg = log -p
who = shortlog -s --
slog = !git --no-pager log --format=oneline --abbrev-commit
clog = log -n 20 --pretty=tformat:'%C(yellow)%h%Creset %ai %C(green)%an%Creset %C(bold cyan)->%Creset%C(bold blue)%d%Creset %s'
ncclog = log --pretty=tformat:'%h %ai %an -> %d %s'
dlog = log -n 20 --pretty=tformat:'%C(yellow)%h%Creset %ai %C(green)%an%Creset %C(bold cyan)->%Creset%C(bold blue)%d%Creset %s' --graph
dfnp = !git --no-pager diff
fuckoff = clean -fdx
see = "!f() { git show --format=fuller \"$@\" | view - -c \"set fdm=syntax\"; }; f"
fixup = commit --amend -C HEAD
econf = config --global -e
filtered-branches = !git branch --list --no-color | cut -c3- | egrep -v '^(resolved|parked)/'
zbranch = !git filtered-branches | fzf -x
zbranches = !git filtered-branches | fzf -x -m
choosebranch = !git co "$(git zbranch)"
seebranch = !tig "$(git zbranch)"
cb = !git choosebranch
bs = branches
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
lasttag = describe --tags --abbrev=0
lt = describe --tags --abbrev=0
la = "!git config -l | grep alias | cut -c 7- | showaliases -a -"
park = "!f() { : git branch; git branch -m \"$1\" \"parked/${1#parked/; }\"; }; f"
parkz = !git park "$(git zbranch)"
# Merge TO: Be in your feature and merge it to the branch you choose
meto = "!f() { : git branch ; local CURRENT=$(git rev-parse --abbrev-ref HEAD); git checkout $1; git merge $CURRENT; }; f"
# Choose files
cf = !tig status
gvdiff = "!f() { git diff \"$@\" | gvim - +'se ro ft=git'; }; f"
mtgv = mergetool -t gvimdiff
mtv = mergetool -t vimdiff
current = symbolic-ref --short HEAD
upstream = !git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
fchanged = !git diff --name-only $(git upstream)
# Show all aliases from the active configuration
aliases = !git config --get-regexp '^alias\\.' | sed 's/alias\\.\\([^ ]\\+\\) /alias \\1=/' | showaliases -
mrpush = push -omerge_request.create -o merge_request.draft
[hub]
protocol = https
[tig]
diff-context = 10
[tig "bind"]
stage = C !git commit --verbose
status = C !git commit --verbose
[color "status"]
added = "green normal bold"
changed = "red normal bold"
untracked = "magenta normal bold"
header = "cyan normal dim"
branch = "normal normal bold"
[status]
displayCommentPrefix = false
[color "grep"]
context = cyan normal dim
selected = normal normal bold
filename = magenta normal bold
linenumber = green
function = blue normal bold
match = black yellow dim
[mergetool "splice"]
cmd = "vim -f $BASE $LOCAL $REMOTE $MERGED -c 'SpliceInit'"
trustExitCode = true
[mergetool "gsplice"]
cmd = "gvim -f $BASE $LOCAL $REMOTE $MERGED -c 'SpliceInit'"
trustExitCode = true
[difftool "idea"]
cmd = "idea diff $LOCAL $REMOTE"
trustExitCode = true
[mergetool "idea"]
cmd = "idea merge $LOCAL $REMOTE $BASE $MERGED"
trustExitCode = true
[core]
excludesfile = ~/.gitignore_global
[include]
path = ~/.gitconfig.user
path = ~/.gitconfig.local
[pager]
diff = diff-so-fancy | less --tabs=4 -RFX
show = diff-so-fancy | less --tabs=4 -RFX
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = 11
frag = magenta bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse