2

I have made few changes in my remote code on github.com. Now, I need to compare my local master branch with origin. I am using below command to get the diff, but I don't see the diff on the terminal.

git diff master origin/master

If I use the below command, I can pull the latest from origin & I can see my changes pulled in.

git pull origin master

How can I see the diff in master & origin/master without using git pull?

Biffen
  • 6,249
  • 6
  • 28
  • 36
Vik
  • 59
  • 8

1 Answers1

7

Try running the following command:

git fetch 
git diff remote/branch

git fetch updates your tracking branches from the remote.

git diff will compare the remote branch with your local branch.

Pankaj Singhal
  • 15,283
  • 9
  • 47
  • 86