使用Github的几个小建议

Http & Https Proxy

在国内git-remote-https下载上传的速度特别慢,有时候就十来KB。 给Git设置一个网络代理速度翻几十倍。

查看SS的本地端口

我的是1086

image.png

设置代理

git config --global http.proxy socks5://127.0.0.1:1086
git config --global https.proxy socks5://127.0.0.1:1086

查看

git config --global http.proxy
git config --global https.proxy

停用代理

git config --global http.proxy ""
git config --global https.proxy ""

pull --rebase

在合作项目里看到提交树上一堆的merge点很难忍受。推荐用pull --rebase
具体分析看这里http://hungyuhei.github.io/2012/08/07/better-git-commit-graph-using-pull---rebase-and-merge---no-ff.html

配置后git pull 自动执行 git pull --rebase

branch.<name>.rebase

只在某个分支上使用

git config branch.<name>.rebase true

branch.autosetuprebase

为每个新分支设置

git config branch.autosetuprebase always

可选项还有 never, remote, local

pull.rebase

git config --bool pull.rebase true

加上-global就是全局设置了

git config --global pull.rebase true
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容