解决冲突
在merge代码时,可能会产品sub module的冲突如下
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: sub_modules/theme
fiona@localhost static (feature-monitor-fby@0611) $ git diff
diff --cc sub_modules/theme
index 64b115cd7,aeddbb2c0..000000000
--- a/sub_modules/theme
+++ b/sub_modules/theme
在开发分支
git submodule foreach git checkout master //所有子工程切换到master分支 git submodule foreach git pull //所有子工程更新代码 git add 所有子工程目录 git commit -m "update submodule" //这里的提交应该是更新commit id //使其保持最新,与master相同
如果在master分支
git submodule update git checkout 自己的开发分支名 git add 所有子工程目录 git commit -m "update submodule"
更新submodule
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: sub_modules/elemen-theme (new commits)
git pull --recurse-submodules
Comments
暂不支持评论,如有问题,请发邮件至baiyang.feng@outlook.com。 望不吝赐教~