使用Github的幾個(gè)小建議

Http & Https Proxy

在國內(nèi)git-remote-https下載上傳的速度特別慢,有時(shí)候就十來KB。 給Git設(shè)置一個(gè)網(wǎng)絡(luò)代理速度翻幾十倍。

查看SS的本地端口

我的是1086

image.png

設(shè)置代理

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

在合作項(xiàng)目里看到提交樹上一堆的merge點(diǎn)很難忍受。推薦用pull --rebase
具體分析看這里http://hungyuhei.github.io/2012/08/07/better-git-commit-graph-using-pull---rebase-and-merge---no-ff.html

配置后git pull 自動(dòng)執(zhí)行 git pull --rebase

branch.<name>.rebase

只在某個(gè)分支上使用

git config branch.<name>.rebase true

branch.autosetuprebase

為每個(gè)新分支設(shè)置

git config branch.autosetuprebase always

可選項(xiàng)還有 never, remote, local

pull.rebase

git config --bool pull.rebase true

加上-global就是全局設(shè)置了

git config --global pull.rebase true
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • git常用命令 GIT常用命令備忘:http://stormzhang.com/git/2014/01/27/gi...
    新篇章閱讀 8,889評(píng)論 1 26
  • 本文作者陳云峰,轉(zhuǎn)載請(qǐng)注明。 這篇文章記錄個(gè)人常用的一些命令,和記不住的一些命令,轉(zhuǎn)載了并不斷更新。 Git官網(wǎng) ...
    陳云峰閱讀 2,927評(píng)論 0 24
  • git 使用筆記 git原理: 文件(blob)對(duì)象,樹(tree)對(duì)象,提交(commit)對(duì)象 tree對(duì)象 ...
    神刀閱讀 3,862評(píng)論 0 10
  • 本文針對(duì)初級(jí)用戶,從最簡(jiǎn)單的講起,但是需要讀者對(duì)Git的基本用法有所了解。 Git是開源的分布式版本控制系統(tǒng),...
    Sachie閱讀 1,260評(píng)論 0 2
  • Add & Commit git init 初始化一個(gè) Git 倉庫(repository),即把當(dāng)前所在目錄變成...
    冬絮閱讀 5,155評(píng)論 0 9

友情鏈接更多精彩內(nèi)容