GIT - HEAD 提前提交

GIT - HEAD one commit ahead

我有以下消息:

fatal: Not possible to fast-forward, aborting.

当尝试做 GIT PULL

我做了 GIT REBASE 并且它可以将远程提交提交到分支,但是 HEAD 仍然没有指向分支!?

我想将前面的提交合并到分支。 (生产服务器)

我可以通过以下方式解决我的问题:

$git checkout –b temp #makes a new branch from current detached HEAD
$git branch –f master temp #update master to point to the new <temp> branch
$git branch –d temp #delete the <temp> branch
$git push origin master #push the re-established history

这两个分支现已与 HEAD 合并。