如果已经git pull 后再推送发现还是报

To gitee.com:CarrieProject/mobileApp.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitee.com:CarrieProject/mobileApp.git'
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.

解决办法:这是一个常见问题,要把两个不同的项目合并,需要添加一个强制命令

输入命令:  git pull origin master --allow-unrelated-histories

提示有冲突的文件;去到对应的里面修改好了再

查看状态:

git status

 

输入命令: 
  git add *

输入命令: 

 git commit -m '完成违规登记,管教提醒'

输入命令:

git push origin master
 

回到仓库里就会发现已更新

 

 

 

 

 

 

 

 

 

 

 

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐