解決 git pull 錯誤:Need to specify how to reconcile divergent branches.

  1. 問題發生原因
    1. git push 時的錯誤
    2. git pull 時的錯誤
  2. 查看 git status
  3. 解決方法 Solution
    1. 執行 git config pull.rebase false 並再次 git pull
    2. 再次查看 git status
    3. 最後再執行一次 git push 即可成功
  4. 番外篇:關於 rebase

問題發生原因

可能有其他人使用 branch 並 push 上去,master 版本比我的新,導致我 commit 後想要 push 時出錯

git push 時的錯誤

但想要 pull 時又發生另一個錯誤:Need to specify how to reconcile divergent branches.

git pull 時的錯誤

閱讀更多»