Git 存储库未导出:致命:远程端意外挂断

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1112622/
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-19 03:45:08  来源:igfitidea点击:

Git repository not exported: fatal: The remote end hung up unexpectedly

gitversion-control

提问by Number8

Setting up new git installations.

设置新的 git 安装。

On one Windows laptop, I'm running (under cygwin):

在一台 Windows 笔记本电脑上,我正在运行(在 cygwin 下):

git daemon --base-path=/cygdrive/c/work/proj/  

My project's root is c:\work\proj\proj1. There is a c:\work\proj\proj1\.git directory.
git-daemon-export-ok exists in c:\work\proj\proj1. (git-daemon-export-ok can be an empty file, yes?)

我的项目的根目录是 c:\work\proj\proj1。有 ac:\work\proj\proj1\.git 目录。
git-daemon-export-ok 存在于 c:\work\proj\proj1 中。(git-daemon-export-ok 可以是一个空文件,是吗?)

On another Windows computer, on the same local network, I've tried many variations of this (under cygwin):

在同一本地网络上的另一台 Windows 计算机上,我尝试了许多变体(在 cygwin 下):

git clone git://xx.xx.xx.xx/proj1  

I expect that the daemon will append 'proj1' to the base-path and do the right thing.

我希望守护进程将“proj1”附加到基本路径并做正确的事情。

On the server I see:

在服务器上我看到:

5728] '/cygdrive/c/work/proj/proj1/.git': repository not exported.

On the client I see:

在客户端我看到:

$ git clone git://xx.xx.xx.xx/proj1
Initialized empty Git repository in /cygdrive/c/work/proj/proj1/.git/  
fatal: The remote end hung up unexpectedly

What am I doing wrong?
TIA...

我究竟做错了什么?
蒂亚...

回答by Ted Percival

You need to create the git-daemon-export-okfile in the .gitdirectory. Don't commit it into the repository along with your code, but just create an empty file with that name along with the branches, hooks, info, etc. directories.

您需要在目录中创建git-daemon-export-ok文件.git。不要犯它与你的代码一起存储库,而只是与一起创建一个相同名称的空文件brancheshooksinfo,等目录。

回答by daemon

If you are using gitosis you must add the two following lines in gitosis.conf (note: "repo" != "group") :

如果你正在使用 gitosis,你必须在 gitosis.conf 中添加以下两行(注意:“repo”!=“group”):

[repo myrepo]
daemon=yes

When you push gitosis-admin, it will create git-daemon-export-okautomatically.

当你 push 时gitosis-admin,它会git-daemon-export-ok自动创建。

If you try to create the file manually in the repository instead, it will keep disappearing after some time.

如果您尝试在存储库中手动创建文件,它会在一段时间后继续消失。

回答by moonlightcheese

i had this same issue, but for a different reason. if Ted's answer doesn't work for you, try adding "--enable=receive-pack" to your git-daemon options. this did the trick for me.

我有同样的问题,但出于不同的原因。如果 Ted 的回答对您不起作用,请尝试将“--enable=receive-pack”添加到您的 git-daemon 选项中。这对我有用。