2011-10-17 14 views
3

我是GIT的新手。我正在Ubuntu機器上開發項目。GIT新手:如何檢查我的情況發生了什麼變化?

在我的項目的根路徑,當類型git status,我得到了終端窗口下面的輸出:

# 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 

但是,我不知道什麼已經改變/修改這些文件,如何檢查什麼這兩個文件是否發生了變化?

回答

8

只要運行:

git diff 

如果你想從這樣的命令漂亮的彩色輸出,這是值得設置配置選項color.ui,如:

git config --global color.ui auto 
+0

我運行「git的差異」,並得到一些輸出以「+」和「 - 」符號開頭,它們代表什麼? – Leem

+1

以'+'開頭的行顯示已添加的新行,而以'-'開頭的行顯示文件中的行但現在已被刪除的行。 –

+0

+1。四。更多。票。注意:使用外部工具(比如Beyond Compare)耦合git diff也可以提供幫助:http://stackoverflow.com/questions/2069490/git-diff-with-beyond-compare/2069950#2069950 – VonC

相關問題