Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

A bunch of new commits have been made on the remote git repository, and you want to see what's changed from the version you have checked out on your computer previously. How do you do so?

share|improve this question
add comment

1 Answer

Simple. First run git fetch to get all the commits on the repo without making any local changes. Then, if your branch is called 'web' for example, run (assuming your remote is called origin)

git diff web..origin/web

or

git difftool web..origin/web

if you want to see the changes in a GUI.

If you want to only check what's changed in one file, you can specify the path to the file

git diff web..origin/web path/within/repo/to/file.py

This should be straightforward to find on Google, but surprisingly wasn't. Putting in the specific commit SHAs is effort and somehow didn't work for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.