Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Git how can I see the diff from master to develop?

Tags:

git

In Git how can I see the diff from master to develop?

I want to see everything that is not the same of the two branchs

like image 596
JMSAZ2013 Avatar asked Nov 06 '13 14:11

JMSAZ2013


People also ask

How do I see my git diff?

You can run the git diff HEAD command to compare the both staged and unstaged changes with your last commit. You can also run the git diff <branch_name1> <branch_name2> command to compare the changes from the first branch with changes from the second branch. Order does matter when you're comparing branches.

Which of the command is used to see the diff in git?

The git diff command is a widely used tool to track the changes. The git diff command allows us to compare different versions of branches and repository. To get the difference between branches, run the git diff command as follows: $ git diff <branch 1> < branch 2>


2 Answers

As explained in these other answers, you can do this by using git-diff to:

  • View all the differences:

    git diff master..develop
    
  • List files that are different:

    git diff --name-status master..develop
    
like image 68
veducm Avatar answered Sep 30 '22 17:09

veducm


git diff [branch1] [branch2] will do it for you.

like image 28
Matt S. Avatar answered Sep 30 '22 16:09

Matt S.