I've been learning about gif diff but I'm still confused about one thing: let's say I make some changes locally. I don't want to add/commit these changes, but I would like to see the differences between my working area and the remote repo. The point is to see the differences between my local files (my Working Area) and the remote repo (origin) before merging them. I've tried this:
git fetch origin master
git diff origin/master (or just "git diff origin")
Am I doing it the right way?
If you read the man page of
git diff
, you will see a list of possible ways how to call it. One of them is:So, you would simply run:
git fetch; git diff origin/whatever
to compare your local worktree changes relative to the named commit.But don't be afraid to create temporary, local commits:
Or, if you are okay with using plumbing commands: