美文网首页
GIT中的强制PUSH

GIT中的强制PUSH

作者: JasonGao | 来源:发表于2015-02-12 11:48 被阅读10711次

错误提示:
error: failed to push some refs to 'https://github.com/bnq456/bnq456.github.io.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.

有如下几种解决方法:
1.使用强制push的方法:
$ git push -u origin master -f

2.push前先将远程repository修改pull下来
$ git pull origin master
$ git push -u origin master

3.若不想merge远程和本地修改,可以先创建新的分支:
$ git branch [name]
然后push
$ git push -u origin [name]

相关文章

  • Git强制提交和强制覆盖本地

    1、git push 强制提交 2、git pull 强制覆盖本地

  • GIT中的强制PUSH

    错误提示:error: failed to push some refs to 'https://github.c...

  • Git pull 强制覆盖本地文件

    Git 强制push本地代码到远端

  • git 强制push

    如果本地版本低于线上版本,本地Push时是不成功的,它需要你pull下代码之后在push,有一种情况是我们不想要线...

  • git 强制恢复

    git reset hahscode git push --force origin master可强制恢复到指定提交

  • git强制推送和更新

    强制推送 // master分支名称git push origin master -u -f 强制更新到本地 gi...

  • Git回退到指定版本

    Git版本回退,在idea中不方便操作,需进行强制提交。主要使用reset和push -f进行强制回退。 1.gi...

  • Git远程代码回滚

    1、本地回滚到指定版本 2、推到回滚的代码到远程仓库 git push -f 可能出现强制push没权限image...

  • 版本回退

    idea界面获取要回退到的版本号 本地回退 git push -f 强制提交远程仓库

  • push to origin/master was reject

    idea中,发布项目到OSChina的Git中,当时按照这样的流程添加Git,然后push,提示:push to ...

网友评论

      本文标题:GIT中的强制PUSH

      本文链接:https://www.haomeiwen.com/subject/rcfsxttx.html