共享rerere缓存

20 git version-control git-merge merge-conflict-resolution git-rerere

我见过人们建议所有开发人员在他们的机器上设置符号链接C:\project\.git\rr-cache到共享文件夹\\server\rr-cache.

但是,如果可以的话,通过将文件夹包含在git存储库中来共享文件夹似乎更方便.我见过人们提到这个解决方案,但实际上并不是这样做的.

有任何想法吗?

Ada*_*ruk 17

它可以通过专用分支共享.如果该分支上存在冲突并解决它,您希望停止,因为这意味着尝试以两种不同的方式解决相同的冲突.不用说,这将成为规则的例外.

对于这个问题上的其他人,谷歌"每个功能分支",看看这是有用的.

钩子可以自动同步常见的rr-cache分支.

以下是您需要自动化的内容.rereresharing是您要合并的示例分支,rr-cache是​​存储分辨率的分支; 所有这些步骤都没有问题:

git checkout --orphan rereresharing start-sprint-1 
git --git-dir=.git --work-tree=.git/rr-cache checkout -b rr-cache
git --git-dir=.git --work-tree=.git/rr-cache add -A
git --git-dir=.git --work-tree=.git/rr-cache commit -m "initial cache"
git clean -xdf
git checkout rereresharing 
git merge --no-ff FTR-1
git merge --no-ff FTR-2
vim opinion.txt # resolve conflict 
git add -A
git commit
git checkout rr-cache 
git --git-dir=.git --work-tree=.git/rr-cache add -A
git --git-dir=.git --work-tree=.git/rr-cache commit -m "resolution"
git remote add origin ../bpf-central
git push origin rereresharing rr-cache 
cd - # assumes you were previously in the other local repo
git remote add origin ../bpf-central
git fetch
git branch rr-cache origin/rr-cache 
ls .git/rr-cache
git --git-dir=.git --work-tree=.git/rr-cache checkout rr-cache -- .
ls .git/rr-cache
Run Code Online (Sandbox Code Playgroud)

您现在已准备好执行相同的合并,您将解决冲突.

  • 您可以为rr-cache创建一个断开连接的分支,即`checkout --orphan rr-cache`.看起来更好 (3认同)

ssc*_*rth 5

也许不是共享rr-cache另一个选项,而是使用rerere-train.sh从现有 Git 历史记录中学习冲突解决方案