答案在底部。
我试图查看 git_test2
目录中我文件的 status
,其中包含 3 个名为 test1.txt
、test2.txt
和 test3.txt
的文件。
这是我输入到终端的内容:
cd Desktop
cd git_test2
git status
一切都很好,直到执行git status
命令。它应该只显示给我三个未跟踪的文件,但是终端返回了这段文本:
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
,现在它显示了我期望的内容。谢谢大家!
pwd
。它返回什么? - Nick Volynkin/Users/ishayfrenkel1/Desktop/git_test2
- Ishay Frenkelgit status
而不是cd git status
吗? - M.M