0

I have done a cherry-pick from branch PRIVATE to branch MASTER. Done without -x (since done from GUI). It created a commit with conflict. Resolved and committed.

I want to see in the future that this commit is a cherry-pick from branch PRIVATE to branch MASTER.

There is no trace of that! When I do:

git log --cherry

I DO see this commit on MASTER, but I cannot find its parent (the private branch).

OkyDokyman
  • 3,786
  • 7
  • 38
  • 50

1 Answers1

1

When you cherry pick a commit a Git, you are actually making a completely new commit. Hence, the commit you made has nothing to do with the original commit and its branch. If you want to explicitly mark this commit as being a cherry pick, then you may use the --edit option:

git checkout master
git cherry-pick --edit <SHA-1 of private commit>

This tells Git to pause and open the commit message editor before finishing the commit. There, you may enter some text which marks the commit as a cherry pick.

Note that if you've already made your commit, but you haven't committed anything else to master just yet, you can still amend the cherry pick commit via git commit --amend. Then, change the commit message to whatever you want to see.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360