-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
89 lines (77 loc) · 2.52 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
[user]
name = VinceCabs
# email = stored in env var
[credential]
helper = store
[core]
editor = code --wait
pager = delta --diff-so-fancy
[interactive]
pager = delta --diff-so-fancy
[credential]
helper = store
[pull]
rebase = false
[fetch]
prune = true
[alias]
# personal
alias = """! git config --get-regexp ^alias\\. \
| sed -e s/^alias\\.// -e s/\\ /\\ =\\ / \
| sort \
""" # print these aliases
st = status --short --branch
co = checkout
cb = checkout -b # create branch and checkout on it
newb = checkout -b
master = checkout master
main = checkout main
a = add
aa = add -A
ssave = stash save
slist = stash list
spop = stash pop
sdrop = stash drop
unstage = reset HEAD
nuke = reset --hard HEAD
c = commit
cm = commit -m
amend = ! git commit --amend
br = branch
brd = branch -d
brD = branch -D
# list branches and authors
brlist = "! git for-each-ref --format=' %(authorname) %09 %(refname)' --sort=authorname"
# list my branches
brlistmy = "! git for-each-ref --format=' %(authorname) %09 %(refname)' --sort=authorname | grep "$(git config user.name)
# rename branch
rename = "!f() { branch_name=$(git rev-parse --abbrev-ref HEAD); git branch -m $1; git push origin $1; git push origin --delete $branch_name; }; f"
merger = merge # because I often type "merger", don't know why
l = log
ll = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lp = log --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --patch
graph = log --all --decorate --oneline --graph # nice graphs
incoming = log --oneline ..@{u}
outgoing = log --oneline @{u}..
df = diff --name-only
merged = branch --merged
dmerged = !git branch --merged | grep -v \"\\*\" | xargs -n 1 git branch -d # delete merged branches
pushu = push -u origin HEAD
f = fetch --all
fpull = fetch --all && pull
# print TODO (details)
todo = "! git grep --extended-regexp -I --line-number --break --heading --color=auto 'TODO|FIXME'"
# print TODO (short)
td = "! git grep --extended-regexp -I --line-number --count 'TODO|FIXME'"
[delta]
navigate = true # use n and N to move between diff sections
side-by-side = true
# line-numbers-left-format = ""
# line-numbers-right-format = "│ "
# delta detects terminal colors automatically; set one of these to disable auto-detection
# dark = true
# light = true
[merge]
conflictstyle = diff3
[diff]
colorMoved = default