Compare Working Directory file with remote repository file

Asked

Viewed 2,983 times

1

How to compare a local file in Working Directory to an existing file in a remote repository, for example Github?

I need to identify changes made to a local file compared to the version on Github. I haven’t executed the command yet git add about this file, therefore it is still in the Working Directory.

  • git diff doesn’t work?

  • Try to execute the answer in the following question:
 http://stackoverflow.com/a/1800787/3797668

1 answer

3


Imagining that you’re working on the branch master in remote called origin, would look like this:

  1. Update your master branch with the latest Github changes

    git fetch origin master

  2. Diff to see what has changed between files on Working directory and in the master:

    git diff origin/master

Browser other questions tagged

You are not signed in. Login or sign up in order to post.