簡體   English   中英

Git處理與跟蹤和未跟蹤文件的合並沖突

[英]Git Dealing with merge conflict with tracked and untracked files

我在這個develop分支,我結帳到新的本地分支以開發新功能。

git checkout -b task-change-title-and-styling

然后現在我做了一些代碼更改,現在我已經trackeduntrack tracked文件。

我知道不會發生合並沖突的常見做法如下:

git add .
git commit -m "Change titles and styling on homepage"
git fetch origin
git rebase origin/develop
git push -u origin task-change-title-and-styling

完畢。

現在在我知道我的更改將與其他更改沖突的新情況下,我該怎么辦(假設我同時擁有trackeduntracked文件)?

以下只是我處理合並沖突的假設,但不確定步驟是否正確

git add .
git commit -m "Change titles and styling on homepage"
git fetch origin
git rebase origin/develop

*at this point i assume my git will have merge conflict message*

然后我修復我的合並沖突,然后我做

git add .
git rebase --continue
*there are still conflict message*

再次修復我的代碼,然后執行

git add .
git rebase --continue
*now no more merge conflict message*
git push -u origin task-change-title-and-styling  

你的假設是正確的。 雖然,我從來沒有在 rebase 之前使用 git fetch origin,因為 git gebase origin/develop 已經做了最新版本的開發分支的拉取

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM