- we needs to Export the list of commits which are there in one branch(branch1) but not there in another branch(branch2) with committer id in bitbucket. So Please let me know if any such kind of option available in Bitbucket *
Asked
Active
Viewed 58 times
-1

Naidu5
- 17
- 2
- 8
-
1Does this answer your question? [Using Git, show all commits that are in one branch, but not the other(s)](https://stackoverflow.com/questions/1710894/using-git-show-all-commits-that-are-in-one-branch-but-not-the-others) – ams Jun 08 '23 at 15:33
-
@ams , we also needs to export the author of the commit, the above one gives the commit id and commit message but not committer id. – Naidu5 Jun 09 '23 at 05:39
1 Answers
1
Here's the recipe:
git log --pretty=format:"%h %ae %s" branch1 ^branch2
- Plain branch names (
branch1
) say which branches' commits to include. - Branch names prefixed with
^
(^branch2
) say which branches' commits to exclude. Beware some shells might need that quoted. %h
is the short commit hash.%ae
is the author's email address. (%an
would give the name.)%s
is the commit message (subject).- The print format is documented in
git log --help
(actually, all this stuff is documented there).

ams
- 24,923
- 4
- 54
- 75