优化 Git 的命令和设置, 方便使用
命令别名
添加命令别名
.gitconfig1 2 3 4 5 6 7 8
| [alias] st = status co = checkout ci = commit br = branch sub = submodule cp = cherry-pick tail = log -3
|
去掉 (END) 提示
有可能会出现输入 git br
和 git log
后, 列表会出现 (END)
且需要手动输入 q
退出, 执行以下代码即可
1 2
| git config --global pager.branch false git config --global pager.log false
|
记住用户名和密码
1
| git config --global credential.helper store
|
git diff 去掉 ^M
1
| git config --global core.whitespace cr-at-eol
|
忽略文件权限变化
1
| git config --global core.filemode false
|
git shell 中文文件显示
1
| git config --global core.quotepath false
|
添加代理
http代理
1 2
| git config --global https.proxy http://127.0.0.1:1080 git config --global https.proxy https://127.0.0.1:1080
|
socks5代理
1 2
| git config --global http.proxy socks5://127.0.0.1:1080 git config --global https.proxy socks5://127.0.0.1:1080
|
取消代理
1 2
| git config --global --unset http.proxy git config --global --unset https.proxy
|