Get commit list between tags in git
If I've a git repository with tags representing the versions of the releases.
How can I get the list of the commits between two tags (with a pretty format if is possible) ?
Solution 1:
git log --pretty=oneline tagA...tagB
(i.e. three dots)
If you just wanted commits reachable from tagB but not tagA:
git log --pretty=oneline tagA..tagB
(i.e. two dots)
or
git log --pretty=oneline ^tagA tagB
Solution 2:
To compare between latest commit of current branch and a tag:
git log --pretty=oneline HEAD...tag
Solution 3:
git log
takes a range of commits as an argument:
git log --pretty=[your_choice] tag1..tag2
See the man page for git rev-parse
for more info.
Solution 4:
To style the output to your preferred pretty format, see the man page for git-log
.
Example:
git log --pretty=format:"%h; author: %cn; date: %ci; subject:%s" tagA...tagB
Solution 5:
FYI:
git log tagA...tagB
provides standard log output in a range.