在Windows上更新了git 版本后,clone/pull時出現錯誤,
unable to negotiate with *.*.*.*: no matching key exchange methodfound. Their offer: diffie-hellman-group1-sha1
解決方法:在執行git pull/clone之前,輸入:
export GIT_SSH_COMMAND='ssh -o KexAlgorithms=+diffie-hellman-group1-sha1'
這種方法每次打開git窗口,都要重新輸入一次。
可以在C:\Users\Spring\.ssh的config文件下,添加內容如下,[本人測試有作用]
Host *.*.*.*
KexAlgorithms +diffie-hellman-group1-sha1
2、git創建分支后,本地關聯遠程分支
有時候創建分支后,本地分支關聯的是另外一個遠程分支
git branch --set-upstream-to=origin/remote_branch your_branch