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

醉酒当歌 提交于 2019-12-20 18:30:53

问题


Setting up new git installations.

On one Windows laptop, I'm running (under 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?)

On another Windows computer, on the same local network, I've tried many variations of this (under 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.

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...


回答1:


You need to create the git-daemon-export-ok file in the .git directory. 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.




回答2:


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.




回答3:


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

[repo myrepo]
daemon=yes

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

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



来源:https://stackoverflow.com/questions/1112622/git-repository-not-exported-fatal-the-remote-end-hung-up-unexpectedly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!