共享重新缓存 [英] Sharing rerere cache

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

问题描述

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



然而,分享通过将其包含在git存储库本身中,如果可能的话。



有什么想法?

解决方案

可以通过专用分支共享。如果在该分支上发生冲突并解决该问题,您希望停止,因为这意味着尝试以两种不同的方式解决相同的冲突。毋庸置疑,这将是规则的例外。



对于这个问题的其他人,谷歌分支每特征,看看这是有用的。 p>

钩子可以自动同步常用的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初始缓存
git clean -xdf
git checkout rereresharing
git merge --no-ff FTR-1
git merge --no-ff FTR-2
vim opinion.txt#解决冲突
git add -A
git commit
git checkout rr-cache $ b $ git --git-dir = .git --work-tree = .git / rr-cache add -A
git --git-dir =。 git --work-tree = .git / rr-cache commit -mresolution
git remote add origin ../bpf-central
git push origin rereresharing rr-cache
cd - #假设您之前在其他本地仓库中
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-cac他 - 。
ls .git / rr-cache

您现在可以做相同的合并,您将解决您的冲突。


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

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.

Any ideas?

解决方案

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 can automate syncing the common rr-cache branch.

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.

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

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