-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
42 lines (33 loc) · 1.6 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
[user]
name=
email=
[core]
editor = vi # 设置默认编辑器
autocrlf = false # 关闭自动转换 Windows 和 *nix 系统之间的换行符
sparsecheckout = true # 开启稀疏检出,可以过滤 pull 规则,只拉取指定文件或目录
autocrlf = false # Windows 下设置为 false
hookspath = PERSONAL_CONFIG_GIT_DIR/githooks # 定义全局 git hooks 文件目录
excludesfile = PERSONAL_CONFIG_GIT_DIR/gitignore # 定义全局的 .gitignore 忽略文件
fileMode = false # 文件权限变更,不追踪
[pull]
rebase = true # pull 操作,优先使用 rebase 方式
[alias]
ph = !"git rev-parse --abbrev-ref @{u} >/dev/null 2>&1 && git pull $(git remote) $(git symbolic-ref --short -q HEAD) || echo 'no upstream branch'"
fb = !"git fetch $(git remote) $1:refs/remotes/$(git remote)/$1"
sbr = !"for branch in `git branch -r| grep -v HEAD`;do echo -e `git show --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<author:%an%Creset == %C(bold blue)commitor:%cn>%Creset' $branch | head -n 1`; done | sort -r"
[push]
default = current # 默认推送分支设置
[gui]
encoding = utf-8 # 设置编码方式
[i18n]
logOutputEncoding = utf-8 # git log 输出编码
commitEncoding = utf-8 # git commit 输入编码
[http]
sslverify = false
[init]
defaultBranch = main # 默认主分支为 main
[extensions]
worktreeConfig = true # 开启 worktree 配置
# 如果在 /work/ 目录下的项目,则使用下方 path 路径的配置文件覆盖上述配置
#[includeIf "gitdir:/work/"]
# path = ~/gitconfig/work