[英]Is commit needed after resolving merge conflict during Git rebase?
我將另一個分支重新綁定到我的結賬分支上,並在rebase期間發生沖突。 我解決了合並沖突。
$ git status
rebase in progress; onto 77c951b
You are currently rebasing branch 'test' on '77c951b'.
(all conflicts fixed: run "git rebase --continue")
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: br_boss_buha_faktura/forms/br_boss_buha_faktura_head_dtl.frm
modified: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client.val
new file: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client_name.val
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client.val
我是否需要提交上述已解決的合並沖突git commit
還是可以直接使用git rebase --continue
?
這里有一些好的答案,但要回答這個問題。 不,您在解決合並沖突后不需要提交。
通過git add <file>
將解決方案添加到git staging區域后, git rebase --continue
將使用原始提交消息為您提交 。
注意提交哈希值會改變! 因此,當您將此合並到另一個已提交您在分支中更改的分支時,您將遇到將這些分支合並在一起的問題。
注意我說在解決git rebase
沖突后你不需要 git commit
,但如果你願意,你可以 。
如果更有意義的話,將文件從一個提交拆分為一系列單獨的提交可能很有用。 通常你只想解決沖突。 如下所示: 將先前的提交分解為多個提交 。
我明白了
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client.val
請做
git add br_boss_buha_faktura/valuelists/br_boss_buha_faktura_client.val
然后
git rebase --continue
執行git rebase --continue
會重寫您應用於您更改它的表單的當前提交。 它將以與您在test
分支中相同的名稱提交更改。
注意你在提交時變基礎,可能是一個獨立的HEAD狀態! 通常,在master
或staging
分支上有一個rebase。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.