Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: check diff between local working copy and remote working copy

Tags:

git

diff

We have to copy over files to an archaic live server for reasons I can't control so I need to see a diff of what the remote working copy will be compared to my local working copy (which is at a different base).

What are the command lines for this? I've tried several things and they either just hang or don't give the output I need.

like image 950
Dave Heq Avatar asked Nov 01 '25 11:11

Dave Heq


1 Answers

Assuming your remote is named as origin and you are trying to compare your local branch named as master with the remote branch named master, first fetch the remote changes using:

git fetch

then compare your local to the remote using:

git diff origin/master

Visit git diff documentation for more info.

like image 136
Dharam Gollapudi Avatar answered Nov 04 '25 00:11

Dharam Gollapudi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!