-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitconfig
166 lines (156 loc) · 5.07 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[user]
name = Panshi
email = [email protected]
[init]
defaultBranch = master
[core]
editor = vim
excludesfile = ~/.gitignore_global
compression = -1
quotepath = false #中文乱码时,设置为 false 可以解决
untrackedCache = false
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
filemode = true
bare = false
logallrefupdates = true
ignorecase = false
# delta config start [https://github.com/dandavison/delta]
pager = delta
[interactive]
diffFilter = delta --color-only --features=interactive
[delta]
navigate = true
side-by-side = true
line-numbers = true
syntax-theme = Dracula
features = my-dark-theme zebra-dark side-by-side line-numbers decorations
plus-style = syntax "#003800"
minus-style = syntax "#3f0001"
[delta "interactive"]
keep-plus-minus-markers = false
[delta "decorations"]
commit-decoration-style = bold yellow box ul
commit-style = raw
file-style = bold yellow ul
file-decoration-style = none
hunk-header-decoration-style = cyan box ul
hunk-header-file-style = red
hunk-header-line-number-style = "#067a00"
hunk-header-style = file line-number syntax
[delta "line-numbers"]
line-numbers-left-style = cyan
line-numbers-right-style = cyan
line-numbers-minus-style = 124
line-numbers-plus-style = 28
[diff]
colorMoved = default
# delta config end
tool = vimdiff
[difftool]
prompt = false
[merge]
tool = diff3
conflictstyle = diff3
[commit]
template = /Users/vincent/.stCommitMsg
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[color]
ui = true
status = auto
diff = auto
branch = auto
interactive = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = red
[gc]
auto = 0
[pull]
rebase = merges
[rebase]
autoStash = true
abbreviateCommands = true
autoSquash = true
dateRefs = true
[sequence]
editor = interactive-rebase-tool
[help]
autocorrect = 20
[pretty]
better-oneline = "format:%C(auto)%h%d %s %Cblue[%cn]"
[alias]
#
cm = commit
st = status
sw = switch
br = branch
#
bt = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
#
cem = commit --allow-empty -m
# git se test2
se = !git rev-list --all | xargs git grep -F
st = status -sb
ls = ls-files
lg = log -p
last = log -1 HEAD --stat
lo = log --oneline
l5 = log --oneline -5
# one-line log
lp = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
tree = log --pretty=better-oneline --all --graph
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local
sot = log --oneline --simplify-by-decoration --graph --all
spg = log --pretty=format:'%C(auto)%h %C(red)%as %C(blue)%aN%C(auto)%d%C(green) %s'
clo = !git clean -df && git checkout -- .
# Revert commit HEAD^ 的意思是上一个版本,也可以写成 HEAD^1 HEAD~ HEAD~1,一共 4 种
# 如果你进行了 2 次 commit,想都撤回,可以使用 HEAD~2 HEAD^2
# 如果你进行了 3 次 commit,想都撤回,可以使用 HEAD~3 HEAD^3
undo = reset --soft HEAD^
undo2 = reset --soft HEAD^2
undo3 = reset --soft HEAD^3
unc = reset --soft HEAD~1
unc2 = reset --soft HEAD~2
unc3 = reset --soft HEAD~3
unm = reset --hard ORIG_HEAD
uns = reset HEAD
a = !cd ${GIT_PREFIX:-.} && git add . && git status
aa = !git add -A && git status
acc = !cd ${GIT_PREFIX:-.} && git add . && git commit
aac = !git add -A && git commit
ms = "!f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f"
ml = "!git ls `git merge-span .. $1`"
md = "!git diff `git merge-span ... $1`"
# list branches sorted by last modified
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
p = push
c = !gcop commit
ac = !git add . && gcop commit
pf = push --force
ghelp = !gcop help
gcommit = !gcop commit
gconfig = !gcop config
# Display all the git aliases
al = !git config -l | grep alias | cut -c 7-
als = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Users/vincent/Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true