git推送失败,错误为远程:推送正在尝试删除提交

git推送失败,错误为远程:推送正在尝试删除提交,git,Git,目前,我正在一个单独的功能在单独的分支中开发,并且所有功能都合并到一个主分支中的设置中工作 在将功能分支与主分支同步时,我在推送到远程时遇到以下错误。 在推之前,我执行了以下命令 > feature1_branch$ git push #0 : feature1 work pushed > main_branch$ git merge feature1 #1 : feature1 merged to main > ma

目前,我正在一个单独的功能在单独的分支中开发,并且所有功能都合并到一个分支中的设置中工作

在将功能分支与主分支同步时,我在推送到远程时遇到以下错误。 在推之前,我执行了以下命令

> feature1_branch$ git push                   #0 : feature1 work pushed
> main_branch$     git merge feature1         #1 : feature1 merged to main
> main_branch$     git merge feature2         #2 : feature2 changes merged to main
> main_branch$     git pull                   #3 : to get all other feature changes to main
> feature1_branch$ git pull                   #4 
> feature1_branch$ git merge main_branch      #5 : to make the feature1 branch aligned with main
> feature1_branch$ git push                   #6 : error
#6
处的错误如下:

remote: The push is attempting to remove commit <commit sha> from ref feature1_branch.
remote:推送正在尝试从ref-feature1\u分支中删除提交。
请注意,错误消息中显示的
commit sha
首先提交到
feature\u分支
,并且该分支已经合并


任何帮助都将不胜感激。提前感谢。

您合并了
feature1
分支,但您的
feature1
分支的尖端是他们的
feature1
分支的尖端吗?早期的
gitpush
意味着它可能应该是这样的,但从那时起可能发生了一些变化。(您注意到散列ID匹配表明它没有。)因此:或者,可能是他们的预接收或更新挂钩(产生错误消息)中有一个bug。@torek:谢谢您的回复。是的,预接收挂钩可能是个问题。。