7
A
回答
7
你說你要回去之前初始化和更新,這將是其中的子模塊仍然存在於.gitmodules
,但其未在.git/config
註冊的空目錄的情況。
假設你的子模塊被稱爲foo/bar
,那麼你可以做到以下幾點:
# Move the submodule out of your repository, just in case you have changes
# in there that you realise afterwards that you'd like to preserve:
mv foo/bar/ ~/backups/old-foo-bar/
# Recreate the submodule directory, but empty this time:
mkdir foo/bar/
# Remove all the config variables associated with that submodule:
git config --remove-section submodule.foo/bar
# Note that the submodule name is *without* the trailing slash
0
如果變化COMMITED,那麼你應該能夠檢查引用日誌:
git reflog
一旦你找到了改變設置你失去了,你可以把它合併在
如果。您的變更未提交,則無法恢復。
1
嘗試(與git1.8.3,四月22D 2013)A:
git submodule deinit
(請參閱 「How do I remove a Git submodule?」 )
這會從
.git/config
中刪除整個submodule.<name>
部分對於給定的子模塊
雖然您可能必須刪除該子模塊的工作樹。
相關問題
- 1. 你可以直接在Git子模塊中開發嗎?
- 2. 可以將git子模塊限制爲單個資源嗎?
- 3. 可以更新git submodule來獲取子模塊中的標籤嗎?
- 4. F#模塊可以猴子修補嗎?
- 5. 可以回購遞歸子模塊嗎?
- 6. 可以更改.net中try catch塊的自動填充嗎?
- 7. 重用Git子模塊的子模塊
- 8. 我可以取消更新Meteor嗎?
- 9. 我可以取消定義EXIT_SUCCESS嗎?
- 10. 我可以取消引用lxml.etree.AncestorsIterator嗎?
- 11. 我可以取消DataGridView.CellMouseDoubleClick事件嗎?
- 12. AES128 CBC可以使用0填充嗎?
- 13. 數組可以有尾部填充嗎?
- 14. FlutterLogo可以拉伸填充嗎?
- 15. git子模塊沒有拉取子模塊中的文件
- 16. 我可以從Symfony2中的子模板注入JavaScript塊嗎?
- 17. GIT子模塊更新*刪除未被取消的文件
- 18. Git的子模塊
- 19. 我可以在Ruby中使用模塊內的模塊嗎?
- 20. 子模塊內部的Git子模塊(嵌套子模塊)
- 21. git子模塊是否合理可用?
- 22. Git可以嗎?
- 23. 如果我合併子模塊,Git標籤被移除了嗎?
- 24. 我可以使子視圖在其大小上填充視圖嗎?
- 25. 我可以返回一個DataTable來填充ASP.NET AJAX客戶端模板嗎?
- 26. 我可以從靜態數組中填充Eloquent模型的集合嗎?
- 27. 我們可以在沒有DataAdapter的情況下填充DataSet嗎?
- 28. 我可以使用die來填充變量嗎?
- 29. 我可以使用JavaScript中的內容預填充iframe嗎?
- 30. 我可以用查詢結果填充會話變量嗎?
我想要的是一種保留子模塊的方法,但只需刪除工作區中的填充文件即可。事實證明,我可以刪除目錄,並且不會以任何方式影響子模塊。所以,就我而言,我的子模塊位於名爲projects的目錄中。我可以刪除項目/工具鏈,但內容不見了,但git不記錄刪除。感謝大家嘗試這一個。 – user561638 2011-03-22 14:20:32