git bash 无法推送分支并显示错误消息:“对象目录不存在”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41115613/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 15:31:34  来源:igfitidea点击:

git bash fail to push branch with error message: "object directory does not exist"

gitbash

提问by Georgi

recently I've updated my Git Bash to the latest version and now when I'm trying to push a branch to the remote server I get an error message:

最近我将 Git Bash 更新到最新版本,现在当我尝试将分支推送到远程服务器时,我收到一条错误消息:

$ git push --set-upstream origin bugs/purlin_support_reactions
Counting objects: 41, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (41/41), done.
Writing objects: 100% (41/41), 4.91 KiB | 0 bytes/s, done.
Total 41 (delta 33), reused 0 (delta 0)
remote: error: object directory /192.168.10.1/strengs/strengs_master.git/objects does not exist; check .git/objects/info/alternates.
remote: fatal: unresolved deltas left after unpacking
error: unpack failed: unpack-objects abnormal exit
To //192.168.10.1/strengs/strengs_master.git
 ! [remote rejected] bugs/purlin_support_reactions -> bugs/purlin_support_reactions (unpacker error)

error: failed to push some refs to '//192.168.10.1/strengs/strengs_master.git'

错误:无法将一些引用推送到“//192.168.10.1/strengs/strengs_master.git”

The object directory does exist (checked), check .git/objects/info/alternatesdoes not exist. In info there is only packsfile.

What could go wrong?

对象目录确实存在(已检查),check .git/objects/info/alternates不存在。在信息中只有packs文件。

什么可能出错?

回答by Georgi

So in general. In git version 2.11.0.windows.1if your origin destination begins with \\192.168....or similar the first backslash for some reason is ignored (kind of bug). Workaround - mount network drive i.o. \\192.168....

所以总的来说。在git 版本 2.11.0.windows.1 中,如果您的原始目的地以 \\192.168.... 或类似的方式开头,则第一个反斜杠由于某种原因被忽略(一种错误)。解决方法 - 挂载网络驱动器 io \\192.168....

EDIT:This issue must be solved with upgrade to git v2.12.0

编辑:这个问题必须通过升级到 git v2.12.0 来解决

回答by Jonathan Katon

This is a known issue which is outlined on the git-for-windows github issue tracker page https://github.com/git-for-windows/git/issues/979

这是一个已知问题,在 git-for-windows github 问题跟踪页面https://github.com/git-for-windows/git/issues/979上概述