当在混帐修改了某些文件,使用git status
,出来了以下消息:“git checkout”和“git checkout - ”有什么区别?
On branch dev
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: script.php
所以我通常用git checkout -- script.php
撤消我的编辑,如建议。
我发现无论如何,从collegue,那git checkout script.php
似乎实现相同的结果。
所以,我的问题是:git checkout -- script.php
和git checkout script.php
同义词,还是没有?
请提供至少一个链接到一些文件,证明你所说的。谢谢!
另请参阅[什么是“ - ”(双破折号)是什么意思? (也称为“裸露双破折号”)](http://unix.stackexchange.com/q/11376/8132)。 –