Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent in TFVC of git cherry-pick

I'm sorry for my question but I'm TFS noob user, what is the equivalent in TFVC (Team Foundation Version Control) of git cherry-pick?

like image 971
slacky82 Avatar asked Sep 22 '16 10:09

slacky82


People also ask

What is cherry picked in git?

git cherry-pick is a powerful command that enables arbitrary Git commits to be picked by reference and appended to the current working HEAD. Cherry picking is the act of picking a commit from a branch and applying it to another. git cherry-pick can be useful for undoing changes.

How do I abort a cherry-pick in Git?

As you can see, aborting a cherry-pick in Git is very easy. Just use the git cherry-pick command with the --abort option.

Does cherry-pick USE SAME commit ID?

When you are performing a regular cherry-pick, you will get a new commit hash but the commit message will be the same. However, there is a way to append the origin of a cherry-pick to the commit message : by using the cherry-pick with the “-x” option.


2 Answers

There is one solution that has worked for me.

In TFVC, when you do a merge between 2 branches, there is a radio button where you can select to merge the whole branch or just a particular set of Changesets.

Follow the changeset option.enter image description here

like image 79
lorengphd Avatar answered Oct 13 '22 02:10

lorengphd


First, create a patch for the changeset that you want to cherry-pick:

tf diff /version:C1234 /format:unified > cherry.patch

(Note: be careful about redirecting to a file from PowerShell. It wants to write UTF-16 files which many programs have a hard time coping with.)

Then apply the patch using patch:

patch -p0 < cherry.patch
like image 39
Edward Thomson Avatar answered Oct 13 '22 02:10

Edward Thomson