Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine Commits within TFS

So in Git you can squash multiple commits into a single commit. So for example, let's say I checked in a change, but I realized I forgot something small, so I make the change locally and then I commit again. With Git squash you can merge those into one commit.

My question is does TFS have any sort of method for doing the same thing?

like image 867
Triplell89 Avatar asked Apr 21 '16 21:04

Triplell89


People also ask

Can you combine commits?

To "squash" in Git means to combine multiple commits into one. You can do this at any point in time (by using Git's "Interactive Rebase" feature), though it is most often done when merging branches.

How do I merge commits to a commit?

Squashing a commitIn the list of branches, select the branch that has the commits that you want to squash. Click History. Select the commits to squash and drop them on the commit you want to combine them with. You can select one commit or select multiple commits using Command or Shift .

How do I combine last commit to one?

Suppose that you want to merge the last 3 commits into a single commit. To do that, you should run git rebase in interactive mode (-i) providing the last commit to set the ones that come after it. Here, HEAD is the alias of the very last commit. Note that HEAD~3 means three commits prior to the HEAD.


2 Answers

No. TFVC uses a totally different version control paradigm than Git; it does not support history rewriting actions like squashing and amending.

like image 149
Daniel Mann Avatar answered Oct 27 '22 05:10

Daniel Mann


No, its not supported. You can't change the history of every changest in TFVC. If it can be achieved , it's a violation of the principle of source control.

And also you can't create a new changest then merge with the old changest, There have been a featured request in Uservoice and be declined by PM of TFS.

TFS to merge multiple, non-continuous changesets.

Thanks for the feedback on this idea. We have reviewed this feedback and determined that we will not be able to complete this suggestion in the foreseeable future.

Matt Mitrik TFS Program Manager

like image 22
PatrickLu-MSFT Avatar answered Oct 27 '22 06:10

PatrickLu-MSFT