我有一个只有一个子模块的简单项目。
$ git submodule
964737623a362f6303e87ec41f2c7090c8c2c093 lib/mongodb-php-odm (heads/master-1-g9647376)
我已经对该子模块进行了更改并提交了它们,但无法将它们推送到 github。
$ cd lib/mongodb-php-odm
$ git branch
* (no branch)
master
$ git remote -v
origin git@github.com:colinmollenhour/mongodb-php-odm.git
$ git ls-remote .
964737623a362f6303e87ec41f2c7090c8c2c093 HEAD
6f5f91eff9b1854faa30608f335aee92aa7532eb refs/heads/master
6f5f91eff9b1854faa30608f335aee92aa7532eb refs/remotes/origin/HEAD
6f5f91eff9b1854faa30608f335aee92aa7532eb refs/remotes/origin/master
$ git push origin master
Everything up-to-date
我不明白为什么它说“Everything up-to-date”,因为 964737 提交还没有被推送到 github。很可能我做错了什么,但我不知道那会是什么......
如何将此子模块中的最新提交推送到 github?
最佳答案
您似乎没有提交任何分支,即您的提交不属于任何分支。在您所在的位置创建一个分支,然后启动 gitk 与 master 进行比较,然后根据需要进行 cherry-pick 或 rebase。
关于git - 无法从 git 子模块推送提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4445738/