-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgitconfig
102 lines (85 loc) · 2.86 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
[user]
name = Alex Gyoshev
email = [email protected]
#signingkey = 96174D3CD53476C5
[color]
ui = true
[diff]
algorithm = patience
[difftool]
prompt = false
[merge]
tool = meld
[mergetool "fugitive"]
cmd = vim -c \"Gdiff\" \"$MERGED\"
[mergetool "meld"]
cmd = meld --diff \"$BASE\" \"$LOCAL\" \"$REMOTE\" --output \"$MERGED\"
[mergetool]
keepBackup = false
[alias]
c = commit -m
ci = commit
ca = commit --amend
co = checkout
cp = cherry-pick
current = rev-parse --abbrev-ref HEAD
tracked = rev-parse --abbrev-ref --symbolic-full-name @{u}
a = add
d = diff
dic = diff --cached
s = status
st = status
out = log origin..HEAD
l = log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset %C(cyan)%an%Creset' --abbrev-commit --date=relative
rcont = rebase --continue
# pull --rebase, and preserve merge commits
pl = "!f() { git fetch --prune; git rebase --rebase-merges `git tracked` ; }; f"
sync = "!f() { git pl && git push ; }; f"
stash-sync = "!f() { git stash && git sync && git stash pop ; }; f"
# cherry-pick from ... to ...
cpf2 = "!f() { git checkout $2 && git pull --rebase && git cherry-pick $1 && git push && git checkout $1 ; }; f"
# cherry-pick from current to ....
cp2 = "!f() { git cpf2 `git current` $1 ; }; f"
# edit / add unmerged files
eu = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; vim `f`"
au = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
# show parent (mommy) branch
mom = "!git show-branch | rg '\\*' | rg -v \"`git current`\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//'"
# drop cherry-picks of private files
drop-deleted-by-us = "!git rm `git status --porcelain | grep ^DU | cut -d' ' -f2`"
# add non-whitespace changes
addnw = "!f() { git diff -U0 -w --no-color $@ | git apply --cached --ignore-whitespace --unidiff-zero ; }; f"
# remove branches with gone upstreams
clean-gone-branches = "!f() { git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D ; }; f"
[core]
autocrlf = false
[push]
default = tracking
[branch]
autosetuprebase = always
[commit]
template = ~/.gitmessage
#gpgsign = true
[gpg]
program = gpg2
[init]
defaultBranch = main
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[interactive]
diffFilter = delta --color-only --features=interactive
[delta]
features = decorations
[delta "interactive"]
keep-plus-minus-markers = false
[delta "decorations"]
commit-decoration-style = blue ol
commit-style = raw
file-style = omit
hunk-header-decoration-style = blue box
hunk-header-file-style = red
hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax