将git关联到Team Foundation工作项目 [英] Associating git commits with Team Foundation work items

查看:167
本文介绍了将git关联到Team Foundation工作项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上下文

用于开发的GitHub Enterprise安装。每个开发者都有自己的公共回购,并且组织拥有授权回购。 Pull请求用于代码评论,我们宽松地遵循nvie的 git flow 分支模型。

用于问题跟踪和部署的TFS安装(发布分支)。我们将发布分支镜像到TFS回购站中。



工作项目



现在最难的部分是:我们如何将git提交(最初可能在开发人员的公共分支上完成)与TF工作项目相关联?



我做了什么







我已经读过关于在两个Git-TF项目中将提交与工作项相关联的引用,但我不确定要使用哪种工具以及如何正确使用它。



如果我必须在发布分支上运行脚本,则承诺从提交消息中提取工作项引用,并将它们与发送到TFS的变更集关联起来。但是,允许关联元数据(而不是提交消息)的解决方案将是首选。



我可以选择将TFS中的工作项与git提交关联吗? >解决方案

使用 git-tfs ,您可以使用 metadatas (甚至强制执行策略!)。
$ b 它们在TFS服务器中完成提交时自动关联(如果使用 rcheckin命令



甚至有一个在git commit上创建的git-note可以获得工作项目的标题和一个链接到工作项目的链接!



但是为了在git和TFS之间的同步过程中使用rcheckin,你应该先(明白地)理解它是如何工作的!



当您在TFS中对git commit进行rcheckin提交时,git-tfs会为每个提交在tfs中创建对应的变更集,并获取此变更集的内容以重新创建git提交。所以,即使它在正常工作流程中几乎不可见,但你在gcheckin之后提交的git提交的内容与原始内容不一样(修改了历史记录!)。



如果这个git reporitory被认为是中央存储库,那么这可能是一个大问题,因为每个委托人都必须进行rebase。否则,它不应该是一个问题,因为它是完全透明的,除了特殊情况下,但很容易解决。



不是一个完美的解决方案...


Context

A GitHub Enterprise installation used for development. Every developer has his own public repo, and the organization has the authorative repo. Pull requests are used for code reviews, and we loosely follow nvie's git flow branching model.

A TFS installation used for issue tracking and deployment (the release branch). We mirror the release branch into a TFS repo.

Work Items

Now the hard part is: How do we associate git commits (that may originally be done on the public branches of the developers) with TF work items?

What I did

I've looked at the following projects for help:

I've read references to associating commits with work item in both Git-TF projects, but I am unsure what tool to use, and how to go about it exactly.

I would be fine if I had to run a script on the release branch commits to extract work item references from the commit message and associate them with changesets sent to TFS. However, a solution that allows the association in metadata (instead of commit messages) would be preferred.

What are my options to associate work items in TFS with git commits?

解决方案

With git-tfs, you can associate workitems in a commit message using metadatas (and even force commit policy!).

They are automaticaly associated when the commit are done in the TFS server ( if you use the rcheckin command )

And there is even a git-note created on the git commit to have the title of the workitem and a link toward the workitem!

But to use rcheckin in a synchronisation process between git and TFS, you should before (abolutely) understand how it works!

When you rcheckin git commits in TFS, git-tfs, for each commit create the corresponding changeset in tfs and fetch the content of this changeset to recreate a git commit. So, even if it's (nearly) invisible for you in a normal worklow, you have the git commits after the rcheckin that are not the same than the original ones (there is a modification of the history!).

That could be a big problem if this git reporitory is supposted to be the central repository because every commiters will have to do a rebase. Otherwise, it shouldn't be a problem because it's completly transparent, except in special cases but easily solvable.

Not a perfect solution...

这篇关于将git关联到Team Foundation工作项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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