0

I have two branches devel and next. In devel I have a more or less huge amount of commits. Some of the commits are cherry picked into next. Also I added some commits to next and I have commits which are merged from devel.

Now I would like to see which commit is missing in next from devel, so I can cherry-pick the missed commit to next. My question is now,

How to check same commits between the devl and next The commits from devel is there or not in next? If not there I would have to cherry-pick to next.

vijay
  • 117
  • 1
  • 1
  • 7
  • You have a potential problem here, because when you cherry picked those commits from `devel` to `next`, Git assigned a new SHA-1 hash to them. This means that you can't simply compare hashes to answer your question. Maybe the best solution long term for your problem would be to develop a better Git workflow. – Tim Biegeleisen Feb 19 '16 at 05:34
  • Once you get `next` to the state you want (i.e. once it has everything in `devel`), I would do a `git merge -s ours devel`. This will let git know that all the changes have been moved over. Then from now on, just merge from `devel` to `next`, don't cherry pick. – David Deutsch Feb 19 '16 at 13:56

2 Answers2

1

You want the cherry-pick-related options git log has, one of --cherry-mark, --cherry-pick:

git log --cherry-mark next...devel        # <-- three dots, not two, for symmetric diff.

Do note that any text-diff-based solution can be fooled here, and avoiding even the off chance is one of the reasons to do only recorded merges in published work.

jthill
  • 55,082
  • 5
  • 77
  • 137
0

You can do

git log devel..next

This will show you commits that devel has but not in next

user376507
  • 2,004
  • 1
  • 19
  • 31