git子模块更新
Git submodules seem to confuse people and I can probably count myself in that group of people that are confused. Their code is kind of part of the codebase, kind of isn't. Pulling the latest code from the overall project doesn't pull the updated submodule code, so sometimes you get errors and don't know what's going on. To ensure your submodules are always up to date, run this via the command line:
Git子模块似乎使人们感到困惑,我很可能将自己归为那群困惑的人们。 他们的代码是代码库的一部分,不是。 从整个项目中提取最新的代码不会提取更新的子模块代码,因此有时您会遇到错误并且不知道发生了什么。 为了确保您的子模块始终是最新的,请通过命令行运行此命令:
-
- git submodule update --init --recursive
This command ensure your existing submodules are current as well as adds new submodule code whenever appropriate. I like to run this at least once a day just to make sure my code is always up to date. You never know what some of your collaborators have contributed (if you work in a team setting), so running this daily is useful!
此命令确保现有的子模块是最新的,并在适当的时候添加新的子模块代码。 我喜欢每天至少运行一次,以确保我的代码始终是最新的。 您永远都不知道您的一些协作者做出了哪些贡献(如果您在团队环境中工作),因此每天运行此命令很有用!
git子模块更新