-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
108 lines (98 loc) · 3.39 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
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[alias]
d = diff
dc = diff --cached
dcw = diff --cached --word-diff
dn = diff --name-status
dw = diff --word-diff
s = status
st = status
sta = status
a = add --all .
ai = add --interactive
ap = add --patch
apw = !"git -c interactive.diffFilter='git diff --color-words' add -p"
b = branch
ba = branch -a
ch = checkout
cb = checkout -b
co = commit
f = fetch
fp = fetch --prune
fa = fetch --all --prune
dev = checkout develop
develop = checkout develop
main = checkout main
mas = checkout master
master = checkout master
papt = !"git push && git push --tags"
ptm = !"if git rev-parse --verify main &>/dev/null; then git push --tags origin main; elif git rev-parse --verify master &>/dev/null; then git push --tags origin master; else >&2 echo No main/master branch found && exit 1; fi"
rsh1 = reset --soft HEAD~1
chp = cherry-pick
chpn = cherry-pick -n
l = log --show-signature
lp = log --patch --show-signature
rh = reset HEAD
unadd = reset HEAD
unstage = reset HEAD
# commit graph
g = !"git log --pretty='%C(auto)%h%Creset %Cblue%ad%Creset%C(auto)%d %s%Creset' '--date=format:%m-%d' --graph"
# commit graph
ga = !"git log --pretty='%C(auto)%h%Creset %Cblue%ad%Creset%C(auto)%d %s%Creset' '--date=format:%m-%d' --graph --all"
# commit graph (without date)
gs = log --oneline --graph --decorate
# commit graph (without date, all refs)
gas = log --oneline --graph --decorate --all
# commit graph (simplified by decoration)
gi = log --oneline --graph --decorate --simplify-by-decoration
# commit graph (simplified by decoration, all refs)
gis = log --oneline --graph --decorate --all --simplify-by-decoration
# commit graph (full)
gf = !"git log --pretty='%C(auto)%h%Creset %Cblue%ad%Creset %Cred%an%Creset%C(auto)%d %s%Creset' '--date=format:%Y-%m-%d %H:%M' --graph --all"
# miscellaneous
w = rebase -i
war = rebase -i
# stage new, modified and removed files
wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm"
# prune local branches that have been merged (excluding master and the current branch)
pl = !"git branch --merged|grep -v "\\*"|grep -v master|xargs -n 1 git branch -d"
# set upstream to origin/<branch> or <remote>/<branch>
# sup <branch>
# sup <remote> <branch>
sup = "!f() { if [ -z $1 ]; then echo 'Branch name required.' 1>&2; return 1; fi; if [ -z $2 ]; then set origin $1; fi; git branch --set-upstream $2 $1/$2; }; f"
# create branch with upstream set to origin/<branch> or <remote>/<branch>
# bru <branch>
# bru <remote> <branch>
bru = "!f() { if [ -z $1 ]; then echo 'Branch name required.' 1>&2; return 1; fi; if [ -z $2 ]; then set origin $1; fi; git checkout -b $2 $1/$2; }; f"
# merge current branch upstream
# mu
mu = "!f() { upstream=\"$(git rev-parse --abbrev-ref --symbolic-full-name @{u})\"; if [ $? -ne 0 ]; then return 2; fi; git merge \"$upstream\"; }; f"
[core]
excludesfile = ~/.gitignore
editor = /usr/local/bin/vim
[include]
path = .gitprivate
path = .gitlocal
[init]
defaultBranch = main
[push]
default = simple
[merge]
conflictstyle = diff3
[pull]
rebase = false
[rerere]
enabled = true
[diff]
tool = vimdiff
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[checkout]
defaultRemote = origin