1

I have a git repo in which some changes went into a release branch, but I've lost track if these are also in master branch.

Using git cherry I get only 3 commits as missing between master and the release branch.

However, on the github page if I go to the release branch, it says that it is 10 commits ahead of master (and even some commits behind master - but I don't necessarily care about that)! How is that possible if on the console I get something else? Thank you!

user3144292
  • 402
  • 2
  • 6
  • 16
  • When you do cherry-pick, the commit-hash is changing from the original one, so you see `10 commits ahead of master...` message. – Sajib Khan Nov 05 '17 at 13:31

1 Answers1

0

How is that possible if on the console I get something else

First, make sure to do a git fetch, in order to be sure to have the local history of the remote repo origin up-to-date.

Second, git cherry, used to see which commits in one branch aren't in the other, works with the content of the commits, not their metadata (date, author, ...).
Whereas a branch comparison (simple diff) compare the commits themselves, which have different SHA1. See "git ahead/behind info between master and branch?" in order to get the same result locally.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • So how would I find out then if I'm actually missing any commits in master that are in the release branch only? – user3144292 Nov 05 '17 at 19:02
  • @user3144292 you could rebase the `release` branch (or rather, a branch created at current `release` HEAD) onto `master`: the commits actually replayed on top of `master` are the one which were in `release` only. The other ones would *not* be replayed by the rebase. – VonC Nov 05 '17 at 19:04