【发布时间】:2016-11-13 21:02:34
【问题描述】:
我知道到处都有人问过这类问题,但我找到的答案都没有帮助。典型问题:
[me@my_server]$ git merge origin development
Already up-to-date. Yeeah!
[me@my_server]$ git push origin development
To ssh://git@git.work.com:8022/my_project
! [rejected] development -> development (non-fast-forward)
error: failed to push some refs to 'ssh://git@git.work.com:8022/my_url'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again. See the 'Note about
fast-forwards' section of 'git push --help' for details.
推送错误对我说的是某些东西不同步。如果我的推送被接受,在提交链的某个地方,一些提交的历史将会丢失。接受我的推送将强制发生非线性更改,而不是以线性方式将每个更改提交到远程开发分支。
解决方案是将开发中发生的任何事情合并到我的本地分支,对吗? ...但是我的分支已经完全与开发同步。因此,如果除了我试图推送的一个更改(我刚刚创建了一个新文件)之外,2 个分支匹配,那么它为什么会拒绝?这个离线的非快进提交在哪里?是否有一些日志我可以检查以找到有问题的孩子并销毁它?
谢谢
【问题讨论】:
标签: git merge push branch commit