2

是否有解决 git 的笔记分支(git-notes)中的合并冲突的最佳方法。做一个通常的做法

git pull --rebase origin refs/notes/commits:refs/notes/commits    

不起作用。我尝试的方法是

git checkout refs/notes/commits
git fetch origin refs/notes/commits:refs/notes/origin/commits 
git merge FETCH_HEAD 
git update-ref refs/notes/commits 

但它会产生合并冲突并破坏历史。请帮忙。立即提供帮助将不胜感激。谢谢

4

1 回答 1

1

For example, if there is a conflict in file A, then file A gets merged, but file B does not get merged

As mentioned in "Merging git notes when there are merge conflicts in them"

git fetch origin refs/notes/commits:refs/notes/origin/commits
git notes merge -v origin/commits

If there are conflicts, it will now tell you to edit .git/NOTES_MERGE_WORKTREE and then commit the result via git notes merge --commit, or abort the merge with git notes merge --abort.

So B should get merged after the git notes merge --commit.

Note: Git 2.6 (Q3/Q4 2015) will add git notes merge strategies.

于 2013-09-05T10:14:48.620 回答