Luffy船长 2022-08-27 11:10 采纳率: 50%
浏览 86

使用soureTree推送代码报错

img

使用soureTree推送代码报错
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin master:master
Pushing to https://gitee.com/ideploy/ideal-his.git
To https://gitee.com/ideploy/ideal-his.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/ideploy/ideal-his.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.
网上说让使用命令pull但是也不生效,渴望大手子能提供解决方案

  • 写回答

2条回答 默认 最新

  • 天蓝_BlueSky 新星创作者: 编程框架技术领域 2022-08-27 17:18
    关注

    强推,即利用强覆盖方式用你本地的代码替代git仓库内的内容,如果远程仓库是刚建的,没有代码,可以这样操作,尽量避免这种操作方法。
    git push -f
    https://blog.csdn.net/m0_37806112/article/details/82289606建议参考一下
    如果还是不行,可以把库里面的内容清空一下,然后重新克隆然后push,一般建议使用命令行操作

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 8月27日