Git非快进拒绝 [英] Git non-fast-forward rejected

查看:228
本文介绍了Git非快进拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得这个问题已被多次询问,但解决方案通常是我删除了该目录,并重新结束了我的工作。我做了一次提交和推送,但意识到我在提交消息中提到了错误的票号。所以我看了这么快速的解决方案,并在终端中输入以下内容:

  $ git reset --soft HEAD ^ 
$ git commit -m...正确的消息...

唯一的问题是我得到以下错误消息:

 为防止您丢失历史记录,拒绝非快进更新
合并远程更改再次推动之前。有关详细信息,请参阅'git push --help'的'关于
快速转发的注意事项'部分。

我正在使用git-flow模型,并且正在开发分支。

解决方案

强制 git push c $ c>:

  git push origin + develop 


I feel like this question has been asked many times, but the solution is typically "I deleted the directory and re-did my work with a fresh checkout." I did a commit and push but realized that I referred to the wrong ticket number in the commit message. So I looked on SO for a quick solution and ended up typing the following into the terminal:

$ git reset --soft HEAD^
$ git commit -m "... correct message ..."

The only problem is I am getting the following error message:

To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

I am using the git-flow model and am working on the develop branch. How can I merge things back in to make git happy again?

解决方案

Force git push:

git push origin +develop

这篇关于Git非快进拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆