3

I am a newbie in GIT. I am developing project on a Ubuntu machine.

In my project root path, when type git status , I got the following output on terminal window:

# On branch develop
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   Rakefile
#   modified:   db/schema.rb

But, I do not know what has been changed/modified on those files, how to check what are the changes has been made on the two files?

Leem
  • 17,220
  • 36
  • 109
  • 159

1 Answers1

8

Just run:

 git diff

If you want nice coloured output from such commands, it's worth setting the config option color.ui, as in:

git config --global color.ui auto
Mark Longair
  • 446,582
  • 72
  • 411
  • 327
  • I run "git diff" and get some outputs start with "+" and "-" sign, what are they stand for? – Leem Oct 17 '11 at 07:14
  • 1
    Lines that begin with `+` show new lines that you have added, while those beginning with `-` show lines that were in the file but have now been removed. – Mark Longair Oct 17 '11 at 07:15
  • +1. Four. More. Votes. Note: coupling git diff with an external tool (like a Beyond Compare) can help too: http://stackoverflow.com/questions/2069490/git-diff-with-beyond-compare/2069950#2069950 – VonC Oct 17 '11 at 07:28
  • ONE THOUSAND VOTES! You are now officially a git god (you were to me before the badge of course) – VonC Oct 17 '11 at 08:37
  • @VonC: thanks - nothing compared to your extraordinary work here, of course :) – Mark Longair Oct 17 '11 at 09:35