Lau*_*nce 5 git hotfix git-flow
我在使用远程存储库hotfix创建的分支上推送提交时遇到了问题git-flow.
这是错误:
$ git push origin hotfix/MyHotfix
Counting objects:
... etc
To {my remote repo}
! [remote rejected] hotfix/MyHotfix -> hotfix/MyHotfix (no such ref)
error: failed to push some refs to {my remote repo}
Run Code Online (Sandbox Code Playgroud)
我hotfix用标准语法创建了:
git flow hotfix start MyHotfix
Run Code Online (Sandbox Code Playgroud)
这个分支已经存在origin,我可以看到git branch -a.我还检查了分支仍然存在于远程服务器上,因为它在我运行时出现git remote show origin.
有没有人遇到过这个git或者git-flow找到了解决方案?
注意 - 我尝试过的事情:
git remote prune origin),我的同事本地仓库会收到相同的错误更新:
git ls-remote origin并git show-ref显示本地和远程修补程序分支的不同引用,但这是因为我在本地有1个额外提交,并且父提交的引用与引用匹配origin.
看起来这实际上是服务器存储库的问题。在服务器上的裸存储库上运行这些步骤可以清除错误:
git fsck --full
git prune
git gc
Run Code Online (Sandbox Code Playgroud)
注意:根据手册页,git prune不需要,因为git gc调用它,但我正在尝试一切。