Git-Tfs:每个Git Commit的TFS变更集? [英] Git-Tfs: A TFS changeset per Git Commit?

查看:136
本文介绍了Git-Tfs:每个Git Commit的TFS变更集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我们使用TFS,并且试图让Git-TFS工具工作,这样在将它们推送到我们的TFS repo之前使用本地提交时我有更大的灵活性。



我有这个工作,但是当我做一个 git tfs ct 时,它检查我所有的提交到一个TFS变更集中。我错过了什么,或者它是如何工作的?如果它不会将我的每个提交都作为单独的更改集单独推送到TFS,那么它似乎首先破坏了使用git-tfs的目的。

解决方案

我使用rcheckin命令,它将您的新git变更集一次提交给tfs,在每次tfs提交后重新提交剩余的提交以产生一个正常的寻找树。使用checkintool子命令产生一个mergecommit - 我不记得它压扁git提交。



所以我们使用一个正常的git工作流程:签出一个功能分支,在它上面工作,checkout master和'git tfs pull',根据需要重新绑定特性分支,然后合并到master,并执行 git tfs rcheckin 。最后,删除功能分支。在极少数情况下,这种情况已经失败(由于锁定的tfs文件),rcheckin停下来让所有的东西都处于明智的状态,这样一旦阻塞被清除,继续就没有问题了。

总而言之,git-tfs使得使用TFS成为可能。


At work we use TFS, and I'm trying to get the Git-TFS tool to work so that I have more flexibility when working with local commits before pushing them to our TFS repo.

I have this working, but when I do a git tfs ct, it checks all my commits into one TFS changeset. Am I missing something, or is this how it's supposed to work? If it doesn't push each of my commits individually to TFS as separate changesets, then it seems to defeat the purpose of using git-tfs in the first place.

解决方案

I use the rcheckin command which commits your new git changesets to tfs one at a time, rebasing the remaining commits after each tfs commit to yield a normal looking tree. Using the checkintool subcommand produces a mergecommit - I don't recall it squashing git commits though.

So we use a normal git workflow: checkout a feature branch, work on it, checkout master and 'git tfs pull', rebase the feature branch against master if necessary then merge feature to master and do git tfs rcheckin. Finally, delete the feature branch. On the rare occasions this has failed (due to a locked tfs file) the rcheckin halted leaving everything in a sensible state so that once the obstruction was cleared it was no problem to continue.

All in all, git-tfs makes using TFS bearable.

这篇关于Git-Tfs:每个Git Commit的TFS变更集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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