git fatal: 拒絕合並無關的歷史的錯誤解決


本地初始化的項目 與 github 版本不一致, 導致無法提交

$ git pull origin master
來自 https://github.com/itaken/python-login-demo
 * branch            master     -> FETCH_HEAD
fatal: 拒絕合並無關的歷史
解決方法

在pull 時候, 添加–allow-unrelated-histories參數 即可.

$ git pull origin master --allow-unrelated-histories                    
來自 https://github.com/itaken/python-login-demo
 * branch            master     -> FETCH_HEAD
Merge made by the 'recursive' strategy.
 LICENSE | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 LICENSE

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM