2011-10-17 17 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

相关问题