Are there local commits in TFS?

2020-06-08 07:46发布

问题:

Does TFS support local commits?

In other words: Can I

  1. modify the code,
  2. make a local commit (without sharing these changes with others),
  3. test my modifications and
  4. if my changes didn't break anything, do a global commit (thereafter my changes are available to other developers)

in TFS 2012?

If it doesn't, are there any workarounds, which allow this functionality?

回答1:

No it doesn't support this, however it does have a couple of alternatives you can use instead.

1) Branches - All developers work on their own branch then merge to trunk/main when they're happy with their changes.

2) Shelveset - developers shelve any change they don't want to commit yet. This lets you undo your change, or pass it to another developer on the team without losing the change or checking into the main branch

3) Gated Checkins + Unit/Automated tests. Any time a developer checks in, TFS Automatically shelves the changes and runs the tfs build + any associated tests (unit or automated). If everything succeeds then it is checked in. I don't believe this supports manual tests.

or a mix of all of the above.



回答2:

TFS does not support this by itself.

However! Microsoft released Git integration with TFS. Brian Harry blogged about this: Announcing Git Integration with TFS a couple of weeks ago.

Using this setup you can use Git for your local commits and then commit it to Team Foundation Server.



回答3:

Not for the on premise version of TFS (yet), but as of January 2013 Microsoft's hosted Team Foundation Service has Git support, which obviously supports local commits.

http://tfs.visualstudio.com/en-us/news/2013-jan-30.aspx#git%20support



标签: tfs