Reputation: 323
What is git-daemon? Is it a default git function? I am trying to understand this so that I can host a repository on a server that people can push/pull from.
So far I am able to clone a "--bare" repository onto an Apache server, and then use "update-server-info" to allow the repository to be cloned to other collaborators. However, this does not let collaborators push their commits to the "--bare" repository.
I created the "git-daemon-export-ok" file in my "--bare" repository, and ran the command: "git-daemon --verbose /git" but I get an error: "git-daemon: command not found."
Any help would be appreciated.
Upvotes: 11
Views: 14949
Reputation: 96934
man git-daemon
will tell you quite a bit (and yes, it is a built-in that comes with Git). Git daemon is run via git daemon
(notice no hyphen).
However, you should take a look at Gitolite or similar if you intend on hosting Git repositories on a server.
Further, why are you cloning a repository with the intention of having that cloned, and any pushes to it forwarded to the repo it was cloned from? Just clone from the original repository!
Upvotes: 5
Reputation: 2863
git daemon could also be used for purpose of migration to an other service provider.
find PATH-TO-LOCAL-REPOSITORIES-ROOT -maxdepth 1 -mindepth 1 -type d -exec touch {}/.git/git-daemon-export-ok \;
git daemon --verbose PATH-TO-LOCAL-REPOSITORIES-ROOT/*
Upvotes: 0
Reputation: 1112
You could have a detailed understanding by reading https://www.kernel.org/pub/software/scm/git/docs/git-daemon.html
As to the problem git daemon not a git command
you could read this post about how to installing it.http://androidyue.github.io/blog/2013/09/10/install-git-daemon-on-fedora/
Hope this could help you.
Upvotes: 0
Reputation: 144
On your server, in each repository, say, /opt/git/myrepository.git, there is a config file.
Add the following section
[daemon]
uploadpack = true
uploadarch = true
receivepack = true
From the kernel.org page on git-daemon
Upvotes: 0