GIT, GITOSIS, WEBSITE – Paths
I have edited the user’s rights to different repositories by cloning gitosis-admin.git to my local machine, edited
gitosis.conf and added user’s public keys to the keydir and pushed it back to the server. This has been tested with various repositories and works.
I am really confused by the tutorials that describe how gitosis can be used to create a repository that can be used to source-control a folder in the web domain.
I have created a bare repository in the web folder using SSH Putty; added and committed the files to it. Then cloned it to local machine with
git clone git(at)server:web_repo.git
This was successful.
The problem is that when I try to push it back to the server, a repo is created in the /home/git/repositories path and the web folder repo is not affected.
I have tried combining the info from:
3 Solutions collect form web for “GIT, GITOSIS, WEBSITE – Paths”
It might be helpful to know what version of ubuntu you’re using. Gitosis is probably in the apt-get repository, and it’s in Debian Lenny for sure. Installing from the repository is much more clean in my experience. Given the potential for security problems in this software, I’d strongly recommend using the repo. But it’s up to you. If the pulling and pushing succeed there’s no harm in this approach.
When you push to a git repository with gitosis, the hooks (the
post-update is the one you need here.) are executed as the gitosis or git user. I suspect your problem is related to this. You might consider writing a suid
post-update hook, so that it can execute as your user account or as the web-editor or web-server user. You could alternately
chown -R git:git (or
gitosis:gitosis depending on your setup) the local deployment clones. If you have to edit these repositories on the server, remember to use
sudo -u git to make whatever changes as the proper user.
Did you set up a post-update hook in the /home/git/repositories-repo, as described in the “Enabling Auto-Updates Upon Pushing Changes From Your Dev Box”-section on http://danielmiessler.com/blog/using-git-to-maintain-your-website ? This should be the trick to get the content from the central repo to the live-clone. For this to work, the git-user needs write access to the live-clone.
from what you posted in your comments, your shell script is broken, WORKDIR is not set (that line is a remark)
however, i don’t think it’s a good idea what you have in mind (with one exception: what you try to update is your development server)