Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git diff - show only what's new on the remote

Tags:

git

git-diff

I have a local repo and a remote repo on github. For business reasons, they aren't in sync. I've done a lot of work on the local that I'm keeping, and now I'm manually adding whatever's new to the remote, to my local. There are no branches.

When I use the command,

git diff --color master..origin/master

I get good results, showing what changed.... what I have added to the local repo is marked with a - sign, and is shown in red; while what is on the remote is shown in green with + signs.

Is there a way to show only what is new on the remote and not on the local? That is, show me any new files on the remote and show me any new or modified lines in files on the remote (show me all the green +'s)

thanks.

like image 219
Darby Avatar asked Feb 03 '13 07:02

Darby


1 Answers

I believe you can put 3 dots between the two branches in the command and then it does only whats new in the second with respect to the first, i.e.

git diff master...feature

to see what's new on feature, and

git diff feature...master

to see what's new on master. In your case feature can be origin/master and that should work fine.

like image 82
Danny Roberts Avatar answered Sep 29 '22 03:09

Danny Roberts