git pull 出現non-fast-forward的錯誤


1.git pull origin daily_liu_0909:liu_0909
出現non-fast-forward的錯誤,證明您的本地庫跟遠程庫的提交記錄不一致,即
你的本地庫版本需要更新
2.git reset head^
若你的本地庫已經commit最新的更改,則需要回到你的版本更改之前的版本
3.git add .
git stash
版本回退之后,您的更改需要保存起來,以供后面提交
4.git pull origin daily_liu_0909:liu_0909
這個時候你的本地庫要比遠程庫落后一個版本,你就可以順利的pull到遠程庫的代碼
來和和本地的代碼merge
5.git stash pop
看,這個時候我們的版本跟遠程庫的版本一致,我們就可以把之前的代碼拿出來,重新
add、commit了
6.git add .
git commit -m 'liu is handsome'
7.git push origin liu_0909:daily_liu_0909
這個時候你就可以選擇是不是要提交這一次的commit了。


免責聲明!

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



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