Articles → Git → Find The Difference Between 2 Branches In GIT

Find The Difference Between 2 Branches In GIT






Syntax


git diff <branch1> <branch2>



Example




  1. Commit "1.txt" (Master branch gets created).
  2. Create a new branch "MyBranch".
  3. Switch to "MyBranch".
  4. Commit "2.txt".
  5. Run "git diff" command.
Picture showing the output of git diff command
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, May 20, 2020

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250