这是我进入 git
的第一步,我刚刚开始阅读 this link 。在 2.2 Git Basics - Recording Changes to the Repository ,你会发现这样的语句:
When you first clone a repository, all of your files will be tracked and unmodified because Git just checked them out and you haven’t edited anything.
在页面下方几行,您会发现:
Checking the Status of Your Files
The main tool you use to determine which files are in which state is the git status command. If you run this command directly after a clone, you should see something like this:
$ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean
This means you have a clean working directory – in other words, there are no tracked and modified files.
上面突出显示的已跟踪和未跟踪一词显然不一致
也许我遗漏了一些东西,但据我所知,我会说这个短语
This means you have a clean working directory – in other words, there are no tracked and modified files.
应替换为
This means you have a clean working directory – in other words, there are no untracked or modified files.
我也对第一个记录中使用的表达方式 Git just check out 的含义存有疑问。我在这里推测,但是这个表达式是否意味着在克隆存储库后立即对文件进行的任何更改都可以在不进行暂存的情况下提交?
最佳答案
第一个引用在技术上是正确的,克隆存储库后不存在未跟踪和修改的文件。
第二个引用解释了git status
,事实上引用的消息意味着不存在同时跟踪和修改的文件。您实际上可能是正确的,这也可能意味着没有未跟踪的文件,也没有修改的文件。但是您有可能创建一个被忽略的文件,该文件与 .gitignore
中的模式匹配,并且 git status
不会告诉您有关该新文件的信息。
关于git - 下面两种说法明显矛盾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37170831/