#子模块内容更新后 $ cd <module dir> $ git commit -am <msg>
#转到根目录提交,可以看到子模块的提交时作为new commits更新 $ cd .. $ git status On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: aiss-spider (new commits) $ git commit -am "update submodule" [master (root-commit) 89b9dc9] u
# 若是未在子模块提交更新的话,在项目根目录进行status就会显示子模块有更新 $ cd .. $ git status On branch master Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) (commit or discard the untracked or modified content in submodules) modified: <module dir> (modified content) no changes added to commit (use "git add" and/or "git commit -a")
#在模块目录进行status就才能看到具体更新内容 $ 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) deleted: README.MD
#这个时候你在项目根目录提交就不会成功,因为你子项目内容未提交 $ git commit -am "update module" On branch master Changes not staged for commit: modified: pod-library (modified content)
#在子模块目录下未推送更新远程仓库地址情况下进行推送的情形 $ git push remote: Permission to x-spiders/aiss-spider.git denied to <username>. fatal: unable to access '<remote-url>': The requested URL returned error: 403