Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in DevOps and Agile by (19.4k points)

I'm on branch-X and have added a couple more commits on top of it. I want to see all the differences between MASTER and the branch that I am on in terms of commits. I could just do a

git checkout master

git log

and then a

git checkout branch-X

git log

and visually diff these, but I'm hoping for an easier, less error-prone method.

1 Answer

0 votes
by (27.5k points)

You can get a very nice, visual output of how your branches differ with this 

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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...