-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitconfig
132 lines (113 loc) · 3.04 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
[user]
name = "faker"
email = "[email protected]"
[merge]
summary = true
tool = vimdiff
[diff]
renames = copy
tool = vimdiff
[difftool]
prompt = no
[diff "odf"]
command = odt2txt
[diff "jpg"]
command = exiftool
[color]
diff = always
branch = auto
interactive = auto
grep = auto
status = true
showbranch = auto
ui = true
[color "diff"]
meta = magenta black bold
whitespace = red reverse
[color "branch"]
current = bold green
local = normal
remote = bold red
upstream = bold blue
[status]
submodulesummary = -1
[format]
numbered = auto
[alias]
sed = !git ls-files --stage | grep ^100 | awk '{print $4}' | xargs sed $@
# 日志操作简化,并将日志格式化
who = shortlog -n -s --no-merges
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
lp = log --color --pretty=oneline --abbrev-commit --graph --decorate
lns = log --color --name-status --date=iso
lst = log --color --stat --date=iso
ldi = log --color --date=iso
ldp = log --color --date=iso -p
ls = log --oneline
# 最新一条 commit log 摘要
l1 = !git --no-pager log --max-count=1 --date=iso
# 最后一次提交的 hash 串
lh = rev-parse HEAD
gpc= grep -n --color -E
ci = commit
co = checkout
st = status
# 查看远程分支,远程分支会用红色表示出来
ba = branch -a
bv = branch -v
bm = branch -m
bd = branch -d
bc = checkout -b
cb = checkout -b
rt = reset --hard
cp = cherry-pick -x
nb = checkout -b
mg = merge
df = diff
rv = remote -v
fa = fetch --all
# 刻意地创造提交线图分叉
mnf = merge --no-ff
rso = remote show origin
# 清除除在本地有但在远程库中已经不存在的分支 git fetch -p
rpo = remote prune origin
# 'git add -u' 只包含刪除的檔案,不包含新增檔案
# 'git add .' 包含修改和新增的檔案,但是不包含刪除
# 'git addall' 通通加到 staging
au = add -u
awd= add .
aa = !sh -c 'git add . && git add -u'
# To list untracked files
ut = ls-files --other --exclude-standard
# list tracked files
tf = ls-files
# show modified files
lm = ls-files -m
# show deleted files
ld = ls-files -d
# show unmerged files
lu = ls-files -u
unstage = reset HEAD
uncommit = reset --soft HEAD^
amend = commit --amend
# 使用 vimdiff 查看 diff 文件
vdf = difftool
# 临时保存
ss = stash save
sp = stash pop
sl = stash list
[core]
# 对 0x80以上的字符不进行quote,以正常显示中文
quotepath = false
editor = vim
[branch "master"]
remote = origin
merge = refs/heads/master
[push]
# nothing, matching, upstream, simple, current
default = simple
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true