You can, for the simple case, list commits accessible from testbranch
, but not from develop
:
git log testbranch ^develop --no-merges --pretty=oneline
That should be the same as develop..testbranch
(two dots, not three)
See:
If testbranch
has been merged back to develop
, especially in a fast-forward manner, an empty result is expected.
Meaning: once a branch has been fast forwarded into another, there is no stating point anymore:
d---d--t--t--t (testbranch)
|
(develop)
git checkout develop
git merge testbranch
d--d--t--t--t (testbranch, develop)
You don't know anymore "where" testbranch
started.
If you did branch out with testbranch
yourself (that is, in your local repo) not too long ago (less than 90 days), you can check out the git reflog
output, to get back a trace of the new testbranch
event at <sha1>
.
See "How do I check git log
for a “fast-forward” merge?".
Try:
git reflog show testbranch
Then, knowing where that branch started, you can list the commits with:
git log develop ^<sha1>
In your case, you might "know" that testbranch
started at commit1, but my point is: Git alone would not know that (except locally in the reflog, if that branch was created in said local repo)