作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我无法将使用 git-flow
创建的 hotfix
分支上的提交推送到远程存储库。
这里是错误:
$ 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}
我用标准语法创建了 hotfix
:
git flow hotfix start MyHotfix
并且这个分支已经存在于 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
注意:根据手册页,git prune
不是必需的,因为 git gc
会调用它,但我尝试了所有方法。
关于Git push 无法推送到原点 - 没有这样的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14756796/
我是一名优秀的程序员,十分优秀!