`
El_Nino
  • 浏览: 205065 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

git push 失败 error:failed to push some refs to ...

    博客分类:
  • git
 
阅读更多

用git push代码到远程仓库的时候出现错误

error:failed to push some refs to ...

Dealing with “non-fast-forward” errors

From time to time you may encounter this error while pushing:

$ git push origin master 

To ../remote/ 

 ! [rejected]        master -> master (non-fast forward) 

error: failed to push some refs to '../remote/' 

To prevent you from losing history, non-fast-forward updates were rejected

Merge the remote changes before pushing again.  See the 'non-fast forward'

section of 'git push --help' for details.

 

 

2. 先把git的东西fetch到你本地然后merge后再push

$ git fetch

$ git merge

2句命令等价于

$ git pull 

0
2
分享到:
评论

相关推荐

    解决fatal:remote error:You can’t push to git://github.com/username/*.git问题的办法

    解决fatal:remote error:You can’t push to git://github.com/username/*.git问题的办法 今天Git push的时候 fatal:remote error: You can't push to git://github.com/username/*.git Use git@github....

    error: failed to push some refs to 'https://gitee.com/xiao-long

    学习git的基本操作时,遇到问题error: failed to push some refs to 'https://gitee.com/xiao-longlong/git-test.git' 解决办法:先执行git pull --rebase origin master 然后执行git push origin master即可

    关于gitee push 不上 报错原因

    error: failed to push some refs to 'git@gitee.com:yanxiaoxin98/hair.git' 死都push不上去

    Git发现git push origin master 报错的解决方法

    git push origin master 报错的解决方法,分享给大家,具体如下: 错误提示如下 ...error: failed to push some refs to 'git@github.com:kangvcar/Results-Systems--PHP.git' hint: Updates were r

    T-blog:由node.js服务的个人博客

    会报错error: failed to push some refs to 'git@github.com:fatpandaria/T-blog.git' hint: Updates were rejected because the tip of your current branch is behind,这是因为没有git pull,一般进行push要先...

    Git常见错误解决1

    #### 错误三:`error: failed to push some refs to ...` **问题描述:** 在尝试推送更改到远程仓库时可能会遇到此错误,通常是因为远程仓库与本地仓库的状态不一致。 **解决步骤:** 1. **同步远程仓库:** - ...

    git提交项目到码云步骤及出现问题解决办法

    error: failed to push some refs to 'https://gitee.com/heguxin/cas_fn.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by ...

    git常用操作命令

    error: failed to push some refs to 'git@www.yongche-inc.com:che.git' ``` 这表示远程仓库的`master`分支比你的本地`master`分支有更新,需要先拉取最新更改再尝试推送。 ##### 解决方法 首先,从远程仓库拉取...

    dokku-deploy-github-action:使用Github操作部署到Dokku实例

    dokku-deploy-github-action 此操作使部署到Dokku尽可能容易! 输入项 ssh-私钥 用于Dokku部署的ssh私钥。 切勿将其用作纯文本!... error: failed to push some refs to 'dokku@mydokkuhost.com:mydokkurepo'

Global site tag (gtag.js) - Google Analytics