使用git tfs合并两个TFS分支 [英] Merge two TFS branches with git tfs

查看:170
本文介绍了使用git tfs合并两个TFS分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 git-tfs ,我想知道是否可以使用 git-tfs 。我有两个分支$ / MyCompany / Dev& $ / MyCompany的/释放-3.3。版本3.3源自Dev分支。两者都使用git tfs作为不同的git存储库检出。



我想重新将这些更改合并到Dev分支中。这可以用 git-tfs 来实现吗?或者我不得不采取尝试使用TFS工具来实现它?

解决方案

我发现了一个很棒的,如果这样做的hacky方式。 Git tfs使用git config管理它对TFS区域的认识。特别是每个远程 3个属性; url,repository和fetch,例如:

  tfs-remote.default.url = http:// tfsserver:8080 / tfs / collection 
tfs-remote.default.repository = $ / Product / Branch / Component
tfs-remote.default.fetch = refs / remotes / default / master

您可以通过将这3个属性再次以不同的名称设置为<$来添加另一个远程 C $ C>默认。例如:

  tfs-remote.feature_branch.url = http:// tfsserver:8080 / tfs / collection 
tfs -remote.feature_branch.repository = $ / Product / FeatureBranch / Component
tfs-remote.feature_branch.fetch = refs / remotes / default / feature_branch

您现在可能需要发行 git tfs bootstrap



然后你可以发行:

  git tfs fetch -i feature_branch 

然后合并提交使用:
$ b $ pre $ g $ merge tfs / feature_branch


I'm using git-tfs, and I was wondering if it is possible to merge two TFS branches using git-tfs. I have two branches $/MyCompany/Dev & $/MyCompany/Release-3.3. Release-3.3 originates from the Dev branch. Both are checked out as different git repositories using git tfs.

I'd like to re-incorporate the changes back into the Dev branch. Can this be achieved with git-tfs or will I have to resort to trying to do it using TFS tools?

解决方案

I found an awesome, if hacky way of doing this. Git tfs manages it's awareness of areas of TFS using git config. Specifically 3 attributes per remote; url, repository and fetch, for example:

tfs-remote.default.url=http://tfsserver:8080/tfs/collection
tfs-remote.default.repository=$/Product/Branch/Component
tfs-remote.default.fetch=refs/remotes/default/master

You can add another remote by setting these 3 properties again with a different name to default. Eg:

tfs-remote.feature_branch.url=http://tfsserver:8080/tfs/collection
tfs-remote.feature_branch.repository=$/Product/FeatureBranch/Component
tfs-remote.feature_branch.fetch=refs/remotes/default/feature_branch

You may need to issue git tfs bootstrap now.

You can then issue:

git tfs fetch -i feature_branch

Then merge the commits using:

git merge tfs/feature_branch

这篇关于使用git tfs合并两个TFS分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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