共享rerere缓存 [英] Sharing rerere cache

查看:19
本文介绍了共享rerere缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有人建议所有开发人员在他们的机器上设置一个符号链接,从 C:project.git r-cache 到共享文件夹 \server r-缓存.

I've seen people recommend that all developers set up a symlink on their machine from C:project.git r-cache to a shared folder \server r-cache.

但是,如果可能的话,通过将文件夹包含在 git 存储库本身中来共享文件夹似乎更方便.我看到有人提到过这个解决方案,但实际上没有提到如何去做.

However, it would seem more convenient to share the folder by including it in the git repository itself, if that is possible. I've seen people mention this solution, but not actually how to do it.

有什么想法吗?

推荐答案

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

It can be shared via a dedicated branch. You want to stop if there is a conflict on that branch and resolve it as it means that there were attempts to solve the same conflict in 2 different ways. Needless to say, that will be the exception to the rule.

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

For the others on this question, google "Branch per Feature" to see where this is useful.

Hooks 可以自动同步公共 rr-cache 分支.

Hooks can automate syncing the common rr-cache branch.

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

Here is what you need to automate. rereresharing is an example branch that you are merging to, rr-cache is a branch that stores the resolutions; all these steps worked without issue:

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

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

You are now ready to do the same merge and you will have your conflict resolved.

这篇关于共享rerere缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆