git子模块更新_用Git更新子模块

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!

此命令确保现有的子模块是最新的,并在适当的时候添加新的子模块代码。 我喜欢每天至少运行一次,以确保我的代码始终是最新的。 您永远都不知道您的一些协作者做出了哪些贡献(如果您在团队环境中工作),因此每天运行此命令很有用!

翻译自: https://davidwalsh.name/update-submodules-git

git子模块更新

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值