How to Ignore new commits for git submodule

本文介绍了一种解决Git子模块出现未提交更改的方法。通过使用`gitsubmoduleupdate`命令可以有效地将子模块回滚到父仓库指定的旧提交状态,而不会更新父仓库中的子模块最新版本。

the git occured serveral new commits like:

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   bbi (new commits)
    modified:   bbif (new commits)
    modified:   c2c (new commits)
    modified:   e6 (new commits)
    modified:   nodetestif (new commits)

and I don’t know how it comes and the git clean -xdf,git checkout .,git checkout – are all don’t work.

So how to fix it?
Just run:

$ git submodule update

This will revert the submodule the to old commit (specified in parent-repo), without updating the parent-repo with the latest version of the submodule.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值