There have been modifications to the 'app.rb' file since your last commit. Find out whick line has changed.
最后一次提交之后,你又修改了 'app.rb' 這個(gè)文件。找到哪一行被修改過(guò)。
如果倉(cāng)庫(kù)中的文件被修改過(guò),它的狀態(tài)就變?yōu)?'modified',可以使用下面的命令查看被修改的細(xì)節(jié):
$ git diff
$ git diff your-file
第1條命令是列出所有被修改過(guò)的文件的細(xì)節(jié),第2條命令是列出指定文件的被修改過(guò)的細(xì)節(jié)。
比如,你有一個(gè)名為 a.txt 的文件,內(nèi)容如下:
a1
a2
a3
a4
a5
a6
a7
a8
a9
然后,你把其中的 'a5' 改成了 'bbb5',內(nèi)容變成:
a1
a2
a3
a4
bbb5
a6
a7
a8
a9
那么 git diff
的結(jié)果是這樣的:
其中 @@ -2,7 +2,7 @@
表示修改的內(nèi)容是從第2行至第7行,接下來(lái)列出第2行至第7行的內(nèi)容(其實(shí)只修改了第5行這1行,但會(huì)列出這1行的前3行和后3行)。其中紅色的 -a5
和綠色的 +bbb5
表示把 'a5' 改為了 'bbb5'。
第29關(guān)過(guò)關(guān)畫(huà)面如下:
http://wiki.jikexueyuan.com/project/githug-walkthrough/images/level-29-diff.png" alt="第29關(guān) diff" />