为什么git status
说Changed but not updated
但git pull
说Already up-to-date
?
E.g。
$ git st
# On branch develop
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: roles/role-A (new commits)
#
no changes added to commit (use "git add" and/or "git commit -a")
[snowcrash@snow ansible-playbooks]$ git pull
Already up-to-date.
答案 0 :(得分:0)
带子模块的父仓库记录 gitlink (主仓库的special entry in the index)
由于在嵌套的repo roles/role-A
中完成了新的提交,git status提到了gitlink roles/role-A
如果相同的gitlink(它是对sub-repo的SHA1的引用)没有远程更改,你可以执行git pull(将更新其他文件,但不更新roles/role-A
gitlink)< / p>
如果没有任何远程更改,即使您在本地,主回购或子回购中有大量修改/提交,git pull也会说“最新”。