2

My goal is to show what is committed in branch A but not in branch B. I am aware of the existing commands as described in the 2 following threads:

Different commits between two branches

Using Git, show all commits that are in one branch, but not the other(s)

However if I cherry pick commits from B to A, the cherry picks keep showing up in the various commands when I diff between A and B. Am I missing something basic here.

Following are the commands I tried:

git log --cherry-pick --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cred%cn%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative B..A

git cherry B A

git log --oneline A ^B --no-merges

All of them keep showing commits that were already cherry-pick'ed This causes wrongly developers to think that commits are missing from one branch to another.

Thx in advance.

Community
  • 1
  • 1
isaac.hazan
  • 3,772
  • 6
  • 46
  • 76
  • 4
    `cherry-pick` creates new independent (but similar) commits. Git cannot know if a commit was cherry picked or created manually. – knittl Aug 27 '14 at 12:20
  • `git cherry B A` does what you seem to want. Perhaps you are looking for `git cherry B A | awk '/+/{print $2}'` – William Pursell Aug 27 '14 at 12:38

0 Answers0