gitignore 无法忽略带有空格的 files/folders
gitignore fails to ignore files/folders with whitespaces
这是我的 .gitignore 文件:
Textfusion\ Pro/bin/Debug/
Textfusion\ Pro/bin/Release/
.gitignore
.vs/
但是如果我执行 git status
那么文件夹仍然会出现。
我也这样试过:
- Textfusion Pro/bin/Release/
- Textfusion*Pro/bin/Release/
- "Textfusion Pro"/bin/Release/
- "Textfusion Pro/bin/Release/"
您的文件已在存储库中。您必须 git rm
它们(请注意,如果您不想删除它们,则应将 --cached
选项指定为 git rm
)。在那之后,如果你在 .gitignore
文件中像 Textfusion Pro/bin/Release/
这样写,它们应该被忽略。
请注意,即使在您这样做并提交之后,它们仍将存在于存储库历史记录中,占用 space。 Whosebug 上有一些问题解释了如何重写 git 历史记录。
这是我的 .gitignore 文件:
Textfusion\ Pro/bin/Debug/
Textfusion\ Pro/bin/Release/
.gitignore
.vs/
但是如果我执行 git status
那么文件夹仍然会出现。
我也这样试过:
- Textfusion Pro/bin/Release/
- Textfusion*Pro/bin/Release/
- "Textfusion Pro"/bin/Release/
- "Textfusion Pro/bin/Release/"
您的文件已在存储库中。您必须 git rm
它们(请注意,如果您不想删除它们,则应将 --cached
选项指定为 git rm
)。在那之后,如果你在 .gitignore
文件中像 Textfusion Pro/bin/Release/
这样写,它们应该被忽略。
请注意,即使在您这样做并提交之后,它们仍将存在于存储库历史记录中,占用 space。 Whosebug 上有一些问题解释了如何重写 git 历史记录。