2017-03-01 76 views
1

我意外地在另一個repo上創建了一個repo。
我現在只想讓內部回購成爲外部回購的一部分(我不想要子模塊/多回購)。刪除git submodule/repo inside repo fatal:Pathspec'xfile.md'位於子模塊'x'

我走進內回購一取出.git文件夾,但運行git status不顯示任何改變,如果我嘗試和明確git add從內回購文件獲取:

fatal: Pathspec 'xfile.md' is in submodule 'x' 

我試着重新從外部回購git,但沒有運氣。

我只是想在內部回購中刪除,並使其成爲父回購的一部分。有谷歌和堆棧溢出搜索,但答案似乎很快就深入。

回答

1

既然你沒有使用git submodule deinit,手動步驟將包括:

git rm --cached inner_repo 
rm -f .git/modules/inner_repo 
# edit .gitmodules 

由你內心回購的根文件夾名稱替換「inner_repo」。
不要在inner_repo的末尾添加尾隨'/'。
並編輯.gitmodules刪除其中有inner_repo的部分。

+0

它爲我工作 – Prof