Can I Remove the Branch that I have Git Cherry Picked From
Asked Answered
V

1

6

I cherry-picked a commit from a branch that I no longer want.

Is it bad form / will there be any issues if I have cherry-picked a commit that will no longer exist after I delete the branch?

Vitovitoria answered 6/1, 2020 at 20:31 Comment(0)
I
8

Cherry-pick will apply the delta of the source commit to the target branch, which is recorded as a new commit on the target branch. You should be able to safely delete the source branch after successful cherry-pick(as it requires your working tree to be clean).

See the description of 'git cherry-pick' in the documentation: https://git-scm.com/docs/git-cherry-pick

Indecipherable answered 6/1, 2020 at 20:40 Comment(2)
Perfect, this helped. Thanks!Vitovitoria
@BenjaminMiller One minor thing you can potentially lose, depending on how much you value it, is the original branch commit messages. Making good use of the -x argument solves this.Eucalyptus

© 2022 - 2024 — McMap. All rights reserved.