[haiku-development] Re: GIT help

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Mon, 1 Apr 2013 18:22:15 -0400

On Mon, Apr 1, 2013 at 5:44 PM, John Scipione <jscipione@xxxxxxxxx> wrote:
> `git diff` shows you the changes you've made since you last committed, so,
> in this case, it shows you the changes to the rdef file. It is roughly
> equivalent to svn diff. However, once you've added the files using `git add`
> staging them for for commit `git diff` no longer shows them to you.

Further you can see the diff of files you have staged (aka you added
them) by using git diff --cached.

So to summarize:

git diff: shows files that have been changes, but not added or committed.
git diff --cached: shows file that have been staged but not yet
committed (and will NOT show other changes that git diff would show)
git diff origin/master: shows what has changed between your local
branch and the origin's master branch

You can also diff against the history in your repo. For example:

git diff HEAD~2: shows the diff of the last two commits


Other related posts: