Git Submodule
约 1 分钟阅读
- 参考
- git-scm.com/book/en/v2/Git-Tools-Submodules
- HN #31792303Hacker NewsHacker News #31792303Hacker News
# 推荐
git config --global submodule.recurse true
# 添加
git submodule add https://example.com/submodule-repo.git path/to/submodule
# 已有
git submodule init
git submodule update
# clone 包含 submodule
git clone --recurse-submodules http://example.com/repo.git
# 全部更新
git submodule update --remote --recursive.gitmodules
.git
gitdir: ../.git/modules/stubFAQ
local submodule
git -c protocol.file.allow=always submodule add ~/gits/wenerme/kube-stub-cluster/.git stubdetached
# merge 或 rebase 即可
git submodule update --remote --merge
git submodule update --remote --rebase关联信息
反向链接、本文链接的其他页面和外部资料。
参考资料
Hacker News1 条
- Hacker News #31792303HN #31792303
其他外链2 条
- git-scm.com/book/en/v2/Git-Tools-Submodulesgit-scm.com/book/en/v2/Git-Tools-Submodules
- stackoverflow.com/a/55570998/1870054stackoverflow.com/a/55570998/1870054