为什么需要git submodule
适用于你的仓库对其他的仓库依赖,但是像py,java,go等有依赖管理工具解决了这个问题,所以git submodule现在用的不多。但是在cpp中用的还是挺多的。
添加git submodule
git submodule add url git-submodule
然后使用git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: .gitmodules
new file: git-submodule
拉取git submodule
第一次拉取
git submodule update --init --recursive
之后的拉取
git submodule update --remote
查看git submodule 状态
git submodule status