error: failed to push some refs to'https://github.com×××××××××××××.git'
To prevent you from losing history, non-fast-forward updateswere rejected
Merge the remote changes (e.g. 'git pull') before pushingagain.
See the
'Note about fast-forwards' section of 'git push --help' fordetails.
root@Alps:/var/www/shopping# gitbranch
其实这个问题就是, non-fast-forward会丢失修改!
就是需要远程和本地合并再push就对了
git fetch
git pull origin develop(假如你的分支是master,就写master)
这个时候可以再git push就好了,但是这里有个问题,就是gitpull的时候会自动合并分支,但是不一定一定成功
我就是遇到这个问题
CONFLICT (content): Merge conflict inregister_result.php
Auto-merging php_fns.php
CONFLICT (content): Merge conflict in php_fns.php
Auto-merging output_fns.php
CONFLICT (content): Merge conflict in output_fns.php
Auto-merging item-details.php
CONFLICT (content): Merge conflict in item-details.php
Automatic merge failed; fix conflicts and then commit theresult.
这么多文件冲突了,然后好吧。。。解决冲突:
直接的办法,编辑冲突文件:
your code is here
<< << << <</font> HEAD
another code is here
=======
also code is here
>>>>>>> 6853e5ff961e684d3a6c02d4 d06183b5ff330dcc
<< << << <</font>
another code is here
=======
also code is here
>>>>>>>
在这里:<<<<<<<<HEAD和=======之间的文件是你的代码
============和>>>>>>>>>>>是别人的代码。
手动修改好了就行了!!
然后就可以gitpush了,再合并分支。
假如不熟练,本地偷偷备份一个就好了