答案在底部。
我试图在包含 3 个名为 和 的文件的目录中查看我status
的文件。git_test2
test1.txt
test2.txt
test3.txt
这是我在终端中输入的内容:
cd Desktop
cd git_test2
git status
git status
在命令之前一切都很好。它应该只显示 3 个未跟踪的文件,但我从终端获取了以下文本:
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: ../../AndroidStudioProjects/Sunshine/app/src/main/res/layout/list_item_forecast.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/fileEditorProviderManager.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/git.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/other.xml
new file: ../../Library/Preferences/AndroidStudio1.2/options/runner.layout.xml
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: ../../AndroidStudioProjects/Sunshine/app/src/main/res/layout/list_item_forecast.xml
modified: ../../Library/Preferences/AndroidStudio1.2/options/runner.layout.xml
Untracked files:
(use "git add <file>..." to include in what will be committed)
../../.CFUserTextEncoding
../../.Rsupport/
在最后一行之后有很多行,就像最后一行一样(红色)
我刚刚找到了原因:我需要做的就是git init
,现在它完全符合我的预期。谢谢大家!