I found this after running locate git-shell-commands
cat /usr/share/doc/git-1.7.4.4/contrib/git-shell-commands/README
Sample programs callable through git-shell. Place a directory named
'git-shell-commands' in the home directory of a user whose shell is
git-shell. Then anyone logging in as that user will be able to run
executables in the 'git-shell-commands' directory.
Provided commands:
help: Prints out the names of available commands. When run
interactively, git-shell will automatically run 'help' on startup,
provided it exists.
list: Displays any bare repository whose name ends with ".git" under
user's home directory. No other git repositories are visible,
although they might be clonable through git-shell. 'list' is designed
to minimize the number of calls to git that must be made in finding
available repositories; if your setup has additional repositories that
should be user-discoverable, you may wish to modify 'list'
accordingly.
So I ran the following commands as root:
cp /usr/share/doc/git-1.7.4.4/contrib/git-shell-commands /home/git -R
chown git:developers /home/git/git-shell-commands/ -R
chmod +x /home/git/git-shell-commands/help
chmod +x /home/git/git-shell-commands/list
exit
I was then able to run the following as the git
user:
[me@svn ~]$ su git
Password:
Run 'help' for help, or 'exit' to leave. Available commands:
list
git> help
Run 'help' for help, or 'exit' to leave. Available commands:
list
git> list
git> exit
Now I don't see what good help and list are, but the login worked. :)
git-shell
is a restricted shell to be used for push/pull functionality only (i.e.git push
,git fetch
andgit pull
). It's not meant to be interactive, so you should not login in an interactive shell. You can make it somewhat interactive by adding agit-shell-commands
directory in the user's home and symlinking some binaries inside. But it's very limited (there's no binary forcd
, for example), so a better alternative is to login asroot
or asudo
able user and dosudo -u git -s
to get a fullbash
shell under thegit
user.