在專案中,有人推送了新檔案,我沒有拉它們,然后我添加了新檔案,提交,然后嘗試將其推送到 main。
git push -u origin main
退貨
! [rejected] main -> main (non-fast-forward)
然后 git checkout main
給我
README.md: needs merge
error: you need to resolve your current index first
如何解決沖突并繼續我的推送?
uj5u.com熱心網友回復:
您需要打開README.md并洗掉合并標記,在此程序中選擇要保留的貢獻方。
然后添加并提交。
確保您已設定(使用Git 2.6 ,2015 年 9 月):
git config --global rebase.autosquash true
git config --global pull.rebase true
從那里,一個簡單git pull的將在origin/main. 解決沖突,如果有的話。
并推。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/419059.html
標籤:
上一篇:Git-當功能分支包含大量更改時,如何在將功能分支合并到開發時避免沖突
下一篇:為專案串列賦值
