我有一个克隆的回购.有一个目录,称之为a/b/c 曾经是它自己的仓库,即有一个/ b/c/.git /等.
现在我想要在主repo中管理文件.我不关心a/b/c中的历史,所以我删除了a/b/c中的.git目录
但问题是git status完全忽略了a/b/c.我不能git add.就好像我把路径放进了.gitignore(我还没有).
显然之前,git忽略了一个带有.git目录的子目录是有道理的,但是现在它是如何知道差异的?
除了.gitignore和.git/info/excludes之外还有其他地方可以忽略文件吗?.git/config文件中没有任何内容?
我被问到git状态的含义.不多:
/path/to/root/dir $ git status
# On branch fred
nothing to commit (working directory clean)
Run Code Online (Sandbox Code Playgroud)
git补充道.更少(没有)
/path/to/root/dir $ git add a/b/c
Run Code Online (Sandbox Code Playgroud)
art*_*bot 24
我不知道问题是什么,或者它是如何产生的,但这里是我如何固定它,万一别人卡住(五讨厌.):
git rm --cached a/b/c
git commit -m "removed phantom a/b/c dir"
git add a/b/c
git commit -m "finally able to add a/b/c"
Run Code Online (Sandbox Code Playgroud)
有趣的是,git log a/b/c只列出了"终于能......"的提交.git show HEAD^("被删除的幽灵......"承诺说
-Subproject commit c311ccdc91c8be66019aa138d1c4af49a6b7a81c
Run Code Online (Sandbox Code Playgroud)
所以它看起来特别是如何处理它.我将不得不阅读有关子项目和/或子模块的更多信息.
| 归档时间: |
|
| 查看次数: |
4324 次 |
| 最近记录: |