我想在完成后将一个目录及其中的所有文件添加到 git repo
git add“AppDir”
,
然后运行 git status ,它仍然显示“已修改内容,未跟踪内容”,如下所示,这是正常行为吗?
运行git commit -a
也没有帮助。
下面是git status
的详细信息:
bogon:AppDir springrider$ git status
# On branch master
# 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)
# (commit or discard the untracked or modified content in submodules)
#
# modified: AppDir (modified content, untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")
最佳答案
这里的问题是 AppDir
本身就是一个 git 存储库 - 您已经为该存储库上演了一个所谓的“gitlink”。 git status
的输出现在告诉您,在 AppDir
存储库中存在未跟踪的文件和已修改的内容。
如果您确实打算这样做,最好将该存储库添加为 submodule ,而不仅仅是一个普通的 gitlink。
关于git - 不能使用git递归添加目录吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7877496/