我一开始在 admin
分支上工作,但是我需要在 develop
分支上完成一些事情,所以选择了 git pull origin develop
。
几天后,我仍然在 admin
分支上工作,但是加入了那些 develop
的内容。我想要推送到 admin
分支,这样一切都会变得正常。
但是我遇到了这个错误:
! [rejected] admin -> admin (non-fast-forward)
error: failed to push some refs to 'git@git.mygit.com:mygit/mygit.git'
consejo: Updates were rejected because the tip of your current branch is behind
consejo: its remote counterpart. Integrate the remote changes (e.g.
consejo: 'git pull ...') before pushing again.
consejo: See the 'Note about fast-forwards' in 'git push --help' for details.
如果我尝试执行 git pull
,我会再次从 develop
获取内容,并且会破坏我已经做好的一切(我正在使用 rebase
),即使我执行 git pull origin admin
。
我是唯一在 admin
分支上工作的人,而 develop
分支上只有一个人并没有触及 admin
分支。
git branch -vv
* admin 238eab7 [origin/admin: ahead 37, behind 9] Entidades remodeladas. Mapeo de entidades separadas a YAML para mejor organización Limpieza de varias cosas que sobraban (bundles y demás) Separadas las configuraciones por tipo. Separados los servicios por bundle y tipo siguiendo las recomendaciones de Symfony2
develop 7cc5c84 [origin/develop: behind 22] Eurotax funcinoando. Quitado Memcached en el entorno de DEV para DQL y metido en PROD
git branch
时,它会显示这个信息。如果我执行git pull
命令,我会从develop
分支获取内容,这就是问题所在...admin
分支没有变化,最后一次更改是5天前由我进行的,在那之前我已经在admin
分支上执行了git pull origin develop
命令以从该分支获取内容。 - Robert W. Hunter