GIT, GITOSIS, WEBSITE – Paths

I have an Ubuntu server and have installed git and gitosis.
I am new to server administration and have the following gitosis folder tree: /home/git/repositories

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.

  • GIT / RubyMine (Leopard) - can't pull but I can commit and push
  • Run autotests as a result of clicking 'merge pull request' button
  • git-gui disagrees with git status: why?
  • GIT isn't fetching my new branch
  • Using 'git pull' vs 'git checkout -f' for website deployment
  • Find the right parent of a merge commit in a non-interactive way
  • 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:

    http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way

    http://urbanpuddle.com/articles/2008/07/11/installing-git-on-a-server-ubuntu-or-debian

    http://danielmiessler.com/blog/using-git-to-maintain-your-website

    http://toroid.org/ams/git-website-howto

    http://www.ibm.com/developerworks/web/library/wa-git/

  • Git Commit during Git Rebase - what really happens?
  • git clone from->to directory confusion
  • Is there a better way to review your own changes instead of “git diff”
  • Git - how to remove branch from checkout autocomplete
  • Download Submodules on github.com
  • How to make Git temporarily ignore ~/.gitconfig?
  • 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)

    Git Baby is a git and github fan, let's start git clone.