Caution! Just lost nested child repo by doing checkout on parent

一曲冷凌霜 提交于 2019-12-07 23:15:29
VonC

A nested git repo is only recorded as a gitlink, that is a special entry in the index of the main repo.

When you checkout back to your original branch, Git restores the gitlink, but has no idea to which repo that SHA1 is coming from.

To keep both SHA1 and content, you would need to declare repo B as a submodule.
Then you would have a .gitmodules file in the main repo A, which would keep a record of the repo B remote origin url.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!