Git 上传代码执行git pull 报错:! [rejected] master -> master (non-fast-forward) error: failed to push some r

  • Post author:
  • Post category:其他


1、问题

Git 上传代码执行git pull 报错:

! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ‘xxx’


To http://10.3.43.3:32/test/code.git



! [rejected]

master -> master (non-fast-forward)



error: failed to push some refs to ‘http://10.3.


43.


3


:


32


/


test


/


code


.gi


t’



hint: Updates were rejected because the tip of your current branch is behind



hint: its remote counterpart. Integrate the remote changes (e.g.



hint: ‘git pull …’) before pushing again.


hint: See the ‘Note about fast-forwards’ in ‘git push –help’ for details.


2、解决

经过百度后发现原因是仓库中有readme文件,而项目中没有,内容不同步造成的,执行一下语句可:

$git pull origin master –allow-unrelated-histories



版权声明:本文为qq_36939187原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。