Git 非快进被拒绝 [英] Git non-fast-forward rejected
问题描述
我觉得这个问题已经被问过很多次了,但解决方案通常是我删除了目录并使用新的结帐重新完成了我的工作."我做了一个提交和推送,但意识到我在提交消息中引用了错误的票号.所以我在 SO 上寻找一个快速的解决方案 并最终在终端中输入以下内容:
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.
我正在使用 git-flow 模型并且正在开发分支上工作.我怎样才能把东西合并回来让 git 再次开心?
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屋!