When you do a Pull Request in Github or Stash you get a list of the commit from your current branch.
What would be the git command to get a list of the commit which makes up the current branch without specifying the name of the branch which we started from?
You usually need to know from which branch you are coming from in order to list the commit specific to your current branch, as I explained in "Git log to get commits only for a specific branch"
Otherwise, you need to exclude the commits which are not part of only your branch (as suggested by dimirc):
git log mybranch --not $(git for-each-ref --format='%(refname)' refs/heads/ | grep -v "refs/heads/mybranch")
Or simpler, using git merge-base (if HEAD is not on your branch as in this question):
git log $(git merge-base HEAD branch)..branch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With