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