简体   繁体   English

使用Git合并分支

[英]Merging Branch using Git

We're using TFS2010 for our ASP.Net project's VCS. 我们将TFS2010用于ASP.Net项目的VCS。 Recently there's a need to make some minor changes but affecting a lot of files. 最近,需要进行一些小的更改,但会影响很多文件。 Since branching is only reserved for major release, we've decided to use a local branch while trying out Git. 由于分支仅保留用于主要版本,因此我们决定在试用Git时使用本地分支。 An isolated team is working on this local branch while the remaining team members are working on bug fixes for the main branch in TFS. 一个孤立的团队正在该本地分支上工作,而其余的团队成员正在为TFS中的主要分支进行错误修复。

Now we're done and it's time to merge. 现在我们完成了,该合并了。 What we have in mind is to get the latest copy from our TFS and replace into the local branch and manually merge using TortoiseGit. 我们要记住的是从TFS中获取最新副本,并替换到本地分支中,然后使用TortoiseGit手动合并。

What would be the recommended process to merge for our case? 对于我们的案例,建议的合并流程是什么?

What we have in mind is to get the latest copy from our TFS 我们想到的是从我们的TFS获取最新副本

That would be a simple git fetch 那将是一个简单的git fetch

replace into the local branch and manually merge using TortoiseGit. 替换为本地分支,然后使用TortoiseGit手动合并。

Since it is a local branch, not yet push, you can rebase it . 由于它是本地分支(尚未推送),因此可以对其进行基础调整

git checkout yourLocalBranch
git rebase origin/master

That way, you resolve your merges locally, and said branch can be merged back into master at any time (it would be a trivial fast-foward merge). 这样,您就可以在本地解决合并问题,并且可以随时将上述分支合并回master(这将是一次快速的快速合并)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM