Search code examples
gitgithubcherry-pickgit-cherry-pick

Can I Remove the Branch that I have Git Cherry Picked From


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?


Solution

  • 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