English 中文(简体)
摘自Sync Repos
原标题:Git Merge Out of Sync Repos

我开始用电灯跟踪我的定制情况,看看三党网站。 我与一直在使用电梯跟踪其变化的咨询人进行接口。 我试图使这一点容易理解。

  • I have a copy of an export from one of our environments
  • I started a repository using the export as a base [LOCAL] and have been committing to it regularly
  • The consultants have their own repository that is up to date (excludes my changes) [3RDPARTY]
  • I ve forked their git repo [REMOTE]

现在,我想从这里着手处理并合并所有在<>>><>>>>/>和之间不同的档案。

我不关心我目前在联络处拥有的分支或历史。 我只想从现在起就利用REMOTE,发出/接收拉动要求,与咨询人互动。

你如何建议我这样做? 我试图设立一个新的联络处,用3RDPARTY的更新档案来记录所有档案。 然后,我就希望这一新的分支与我的经常发展分支之间出现一片混乱,这将给我带来一场冲突,这样我就能够轻易地将其全部与第三军合并起来,而只是自动地合并,而不是推翻我的所有变化。

最佳回答

你试图复制所有档案,只是合并,但却没有工作。 这应当奏效,但我认为你可能需要遵循我试图解释的一些不同步骤。

应在<编码>3RDPARTY上打上标签,与贵国出口环境中的检查站相同,这是对的第一次检查。 我将打电话到MERGE_BASE。 从而尝试这些步骤:

  • First of all do git checkout master on REMOTE and make sure it is up to date with 3RDPARTY with git pull origin.
  • In REMOTE git branch mergeb <MERGE_BASE> <MERGE_BASE> is the checkin I spoke about in the history that is identical, or as close as identical, to what you would have in your initial creation of LOCAL.
  • Copy the source for your most up to date version in LOCAL directly over top the files in your mergeb branch we just created in REMOTE. DONOT copy the .git directory!
  • In REMOTE on branch mergeb use git add to make sure all your changes are applied to the git index and then run git commit. Now your REMOTE mergeb branch should have identical source to what is in LOCAL. (you could use git remotes to do this with your LOCAL changes, but since you don t care about history I recommend just doing it this way to simplify the process).
  • Checkout the master branch again git checkout master.
  • At this point create a new branch that you will use to contribute to them.. do git checkout -b remote_work.
  • Now, simply merge the mergeb branch into your remote_work branch with git merge --no-ff mergeb. At this point you will probably have all the conflicting merges with their work and your work to resolve.

一旦你完成这一进程,将工作交给你的部门,你现在就应该处于你想要的准确状态。

After all of this, if you want all your work to appear as if you started with what is currently in 3RDPARTY while on the remote_work branch on REMOTE simply do git rebase master.

从那时起,我将在<代码>REMOTE上与<代码>3RDPARTY合并。 背书并保持您的改动,编号为3RDPARTY,载于remote_work。 或<代码>上其他各处 REMOTE repo.

让我知道,这一进程是否为你服务。

问题回答

暂无回答




相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...