Git Diff Head

Here’s how to check what’s changed in your local Git repo vs the master repo.

Git Status tells you what file has changed, but not to the level of detail such as what lines or what code was changed.

git diff HEAD

Git Diff

When working with version control, sometimes you would like to know what files were committed locally vs what’s on the master origin repository. One way to know the difference is to use the git diff or the git log commands. Here are the commands to check the differences between the local and master origin repositories. Diff is better in my opinion since it actually displays the code changes instead of just displaying the commit ID.

$ git diff origin/master..HEAD
$ git log origin/master..HEAD

Subversion Diff

Subversion Diff will display differences between a file in the local working directory versus the same file that’s located in the repository. It will display on the screen what has been edited, modified or deleted. You invoke the Diff command from the Terminal as displayed below.

svn diff