show commit differences between branches git 1

show commit differences between branches git

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative master..branch-X

Here is what the above code is Doing:
1. git log –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset’ –abbrev-commit –date=relative
This is the git log command that will show the commit history of the branch.
The –graph option will show the commit history in a graph format.
The –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset’ option will format the output of the git log command.
The –abbrev-commit option will show the abbreviated commit hash.
The –date=relative option will show the date in a relative format.
2. master..branch-X
This is the range of commits that we want to see.
The first commit is the base commit and the second commit is the tip commit.
In this case, we want to see the commits that are in branch-X but not in master.
If we want to see the commits that are in master but not in branch-X, we can use branch-X..master.

Similar Posts