0

Trying to set up a simple git-daemon on a linux server, and talk to it from a windows box.

On linux server:

  1. Make a folder /home/foo/bar
  2. CD to /home/foo/bar
  3. do a git --bare init here
  4. Do a touch git-daemon-export-ok
  5. CD to /home/foo
  6. Run the command git-daemon --verbose --reuseaddr --base-path=/home/foo --enable=receive-pack

On Windows Client w tortoise Git

  1. Do git.exe clone --progress -v "git://servername/bar" "C:\source\myFolderName" (works)
  2. Create file a.txt, add it to git, and commit (works)
  3. Do a git.exe pull "origin" master and then get fatal: Couldn't find remote ref master (makes sense, master isn't there yet)
  4. Do a git.exe push "origin" master:master and tortoise hangs forever without do anything

I realize why I can't pull from master yet on the remote branch.. but why can't I push my first commit into the remote repo? #4 really should work. Tried it both with tortoise and the mysysgit command line, both cases I hang forever. What am I missing? Server has no useful log

3
  • Does pushing to empty repository works if it is done via SSH? Does pushing via git-daemon works if there is at least one commit in destination repository? May 14, 2010 at 23:55
  • SSH works fine. I can push and pull all day long. But trying to access the same thing with git-daemon, all I get is the forever-hang.
    – bwawok
    May 17, 2010 at 14:36
  • As an alternative I'm currently using: mobiphil.com/2010/03/… - Also allows push and pull but (AFAIK) requires a per repository configuration setting
    – Elva
    Jun 10, 2011 at 14:23

2 Answers 2

0

Unfortunately this is probably a bug in msysgit http://code.google.com/p/msysgit/issues/detail?id=457

As of right now there is a workaround (not in the main branch I think) but no true fix.

2

I tend to access repositories read/write from my server using:

git remote add [email protected]:/repository

Which is git over ssh, not via git daemon. You could use this configuration provided user@server has access to the repository.

Some other things you can do with this:

  • Create a user called git with a shell /usr/bin/git-shell. The user will only be able to perform git operations if you do this - ssh won't work.
  • Create a /home/git/.ssh/authorized_keys file which contains ssh keys that can connect. Any keys added here will let you commit, so you can add several different users' keys.

This setup lets you control who can commit whilst letting anyone clone via the efficient git:// protocol.

However, if you do want to receive packs, I think the correct command is:

git-daemon --verbose --reuseaddr --export-all --base-path=/home/foo --enable=receive-pack

As per this stack overflow post.

1
  • I don't have root on this server, and I can't make users. Need to get git-daemon to work, not use ssh and proper users. Only difference from this to my git command, is the --export-all.. but since I am already doing touch git-daemon-export-ok, it doesn't help :*(
    – bwawok
    May 14, 2010 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .