Looking for a git command which displays commits in a branch that are not merged to master yet, preferably with hash, date, author name and comment.
(This probably is a duplicate question but I couldn't find it on SO)
Looking for a git command which displays commits in a branch that are not merged to master yet, preferably with hash, date, author name and comment.
(This probably is a duplicate question but I couldn't find it on SO)
 
    
    To list commits that are not on master but only only on branch:
git log master..branch
It does not matter which branch is checked out, as you specify the range. Git will find the shortest route from master to branch, first going back on master, not printing the commits, and then listing commits when going forward in history towards branch.
The default format of git log contains all the data you wish to see. But I'd use the --decorate option too, to highlight branches and tags.
 
    
    Use the ^master syntax to exclude commits visible from master (i.e. those merged to the master branch):
git log branch ^master
The format can be customized using the --format option, e.g. --format="format:%H %ad %an %s"
