-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
53 lines (52 loc) · 1.87 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
[url "[email protected]:"]
insteadOf = https://github.com/ # 重写URL,简化和统一Git操作
[user]
name = haoran
email = [email protected]
[core]
editor = vim
# pager = git-split-diffs --color | less -RFX
pager = delta --features mytheme --navigate --side-by-side # 设置分页工具为delta
excludesfile = ~/dotfiles/.gitignore_global # 全局 .gitignore 文件的位置
quotepath = false # 显示文件名时禁用引号
[init]
defaultBranch = main
[status]
short = false
[alias]
br = branch
st = status
ci = commit -v
lo = log --oneline --graph
lp = log --patch
la = log --format='%an <%ae>'
[commit]
template = /Users/haoran/.stCommitMsg # 指定提交消息的模板文件位置
[http]
postBuffer = 1048576000 # 设置HTTP请求缓冲区大小为1GB,适用于处理大文件
# 配置HTTP请求的低速限制,避免超时问题
lowSpeedLimit = 0
lowSpeedTime = 999999
[pull]
rebase = true # 拉取时使用 rebase 而不是 merge,保持提交历史更直线化
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[advice]
skippedCherryPicks = false # 禁用跳过 cherry-pick 时的提示信息
[diff]
colorMoved = default # 为移动代码行启用默认的颜色显示
[merge]
conflictstyle = diff3 # 在合并冲突时的显示风格,merge、diff3、zdiff3
# delta
[include]
path = ~/dotfiles/themes.gitconfig
[delta]
# delta --show-themes
# core.pager 不是 delta,这里的配置不生效
features = mytheme
navigate = true # use n and N to move between diff sections
[interactive]
diffFilter = delta --color-only --pager # 在交互式模式下使用 delta 作为差异过滤器,并仅显示颜色差异