Domanda

My current branch is branch-X. I cherry-pick a commit Y from branch-Z and later plan to merge branch-Y into branch-X. Will commit Y be applied again during the merge?

Matthias

È stato utile?

Soluzione

No, git is clever enough that when you merge branches it does not re-apply patches that founds are already applied.

You can try that with rebasing the branch with the commit from where you cherry-picked it (your branch-Z) into the branch you cherry-picked it (branch-X).

Altri suggerimenti

No, as long as the commit is unchanged git will detect that it is already applied and skip it. If the commit has changed in one of the branches you may get a conflict which is resolved in the same manner as with other conflicts.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top