我的 .gitignore
文件看起来像:
html/
cache/
resources/
# Temp files often created by editors
*.~
我知道希望开始跟踪 html 中的特定目录,所以我添加 `!html/support/
html/
cache/
resources/
# Temp files often created by editors
*.~
# Track support
!html/support/
然而,这样做之后,Git 似乎仍然没有跟踪 html/support/及其所有子项。
如何将之前忽略的目录添加到 Git 存储库?
最佳答案
不忽略不代表跟踪。
就用
git add html/support/
在您的 git 存储库的根目录下。
如果文件仍然被忽略,你可以使用 git add -f
强制添加它(这不会修改 .gitignore
文件,只允许一个几乎没有异常(exception)):
git add -f html/support/
关于linux - 将之前忽略的目录添加到 Git 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23296370/