tags:

views:

92

answers:

2

For example, I could just git pull and then git checkout HEAD-1. But is there a way of seeing the differences before deciding whether to git pull or not?

+5  A: 

Do a git fetch first to update your remote tracking branch. Then use git log ..origin to see what has changed in the "origin" branch. Then you can do a git pull if you are satisfied with the changes.

Greg Hewgill
+2  A: 

If you really want to avoid any trace of the remote changes getting into your repo, you can do a local git clone, which will use hardlinks, so will take almost no extra space, and then apply Greg Hewgill’s answer to that. If you are satisfied, you can go back to the original repository and pull from the local clone to avoid going over the network, although you should follow up with a git fetch in the original repository to make sure your remote tracking branches are up to date.

Normally, that isn’t necessary, of course.

Aristotle Pagaltzis