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

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

问题描述

在工作中,我们使用 TFS,我正在尝试使用 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.

我有这个工作,但是当我执行 git tfs ct 时,它会将我的所有提交检查到一个 TFS 变更集.我错过了什么,或者这是它应该如何工作?如果它没有将我的每个提交作为单独的变更集单独推送到 TFS,那么它似乎首先违背了使用 git-tfs 的目的.

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.

推荐答案

我使用了 rcheckin 命令,该命令一次将新的 git 变更集提交到 tfs,在每次 tfs 提交后重新设置剩余提交以生成正常外观的树.使用 checkintool 子命令会产生一个合并提交——不过我不记得它会压缩 git 提交.

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.

所以我们使用一个普通的 git 工作流程:签出一个功能分支,在它上面工作,签出 master 和 'git tfs pull',如果有必要,将功能分支重新设置为 master 然后将 feature 合并到 master 并执行 git tfs rcheckin.最后,删除功能分支.在极少数情况下,这会失败(由于 tfs 文件被锁定),rcheckin 会停止,让所有内容都处于合理状态,这样一旦障碍被清除,继续操作就没有问题了.

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.

总而言之,git-tfs 使使用 TFS 变得可以忍受.

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

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

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