Git-Tfs: A TFS changeset per Git Commit?

泄露秘密 提交于 2019-12-30 03:28:24

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/11333835/git-tfs-a-tfs-changeset-per-git-commit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!