git/list[1] front-page[2] threads[3] people[4] search[5] about
 

succesfull use of git-shell

From
Alan Chandler <alan@chandlerfamily.org.uk>
Date
Nov 9, 2005, 21:52 UTC
Message-ID
<200511092152.07195.alan@chandlerfamily.org.uk>

I just wanted to give a heads-up on a successful set up and push to a repository where the account accessing the repository runs git-shell.

It turned out to be extremely simple to do - but the documentation that I could find is so terse in places that I wasn't sure it was going to work until I tried it. Two main issues.

1) the man page for git-push describes <repository> as
remote.machine:/path/to/repo.git/
the tutorial isn't much help either as it says
git push <public-host>:/path/to/my-git.git master
whereas I knew I wanted to access an account that was different from mine
2) the directory paths are always specified as absolute in the documentation, 
but (particularly if you are going to set up a public repository which 
several people may be pushing to) its helpful not to know exactly which path 
on the server the repository exists.
In my setup I did the following simple things 
1) created an account called git with a home directory at /var/lib/git and a 
shell of /usr/local/bin/git-shell (you can see where my git is installed) on 
my server (called roo.home)
2) created a an empty repository at /var/lib/git/famtree.git 

a) Logged in as root into the machine that was the server b) Became a git user with

su -s /bin/bash git

(You can't do a normal su git because the default shell immediately throws you straight out again) c) mkdir famtree.git; GIT_DIR=famtree.git git-init-db d) chmod +x famtree.git/hooks/post-update (planning to allow http anonymous access)

3) back on my development machine - pushed the master branch of my current 
repository out to the new one just created with
git-push git@roo.home:famtree.git

It is this last simple command line that I _really_ like. If I wanted to set up some form of centralised development with multiple access to the repository, I only have to append the public keys of those people into the authorized_keys file on that account on the server and I am done.

 
-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Open Source. It's the difference between trust and antitrust.
Next: Alan Chandler
Message 1 of 2 in “succesfull use of git-shell”
  1. Alan ChandlerNov 9, 2005
  2. Alan ChandlerNov 9, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.