基于 git 个子模块创建一个 fat git 存储库
Create a fat git repository based on git submodules
我想知道是否可以这样做:
git clone --recursive <repository with submodule>
git remote add fat-repository <path>
- ???
git add -A && git commit -m "Test" && git push fat-repository master
第 3 步将 de-submodule 存储库,保留 submodule 的内容,但删除它是子模块的任何痕迹.
谢谢!
删除子模块
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
https://www.atlassian.com/git/articles/core-concept-workflows-and-tips
部分:如何将子模块集成回我的项目?
这包含从子模块创建 fat git 存储库的正确方法:
git rm --cached submodule_path (no trailing slash)
git rm .gitmodules
rm -rf submodule_path/.git
git add submodule_path; git commit -m "remove submodule"
特别感谢 Nick Cross 指导我阅读这些说明!
我想知道是否可以这样做:
git clone --recursive <repository with submodule>
git remote add fat-repository <path>
- ???
git add -A && git commit -m "Test" && git push fat-repository master
第 3 步将 de-submodule 存储库,保留 submodule 的内容,但删除它是子模块的任何痕迹.
谢谢!
删除子模块
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule
https://www.atlassian.com/git/articles/core-concept-workflows-and-tips
部分:如何将子模块集成回我的项目?
这包含从子模块创建 fat git 存储库的正确方法:
git rm --cached submodule_path (no trailing slash)
git rm .gitmodules
rm -rf submodule_path/.git
git add submodule_path; git commit -m "remove submodule"
特别感谢 Nick Cross 指导我阅读这些说明!