How to create custom commands for git-shell? According to the documentation:
When -c is given, the program executes non-interactively; can be one of git receive-pack, git upload-pack, git upload-archive, cvs server, or a command in COMMAND_DIR. The shell is started in interactive mode when no arguments are given; in this case, COMMAND_DIR must exist, and any of the executables in it can be invoked.
However, I'm not sure I'm understanding this correctly. I created a user called gituser, and gave him /usr/bin/git-shell as a shell. I created a directory called git-shell-commands, and put a script called 'testy' in it, but I can't make it run via git-shell.
Here is what I'm trying from an other machine:
$ ssh gituser@server.com testy
fatal: unrecognized command 'testy'
Note that git-shell is working, and responding, it just can't find my custom command.
And here is the script:
:/home/gituser/git-shell-commands# ls -l -a
total 12
drwxr-xr-x 2 gituser gituser 4096 Jan 22 17:35 .
drwxr-xr-x 4 gituser gituser 4096 Jan 22 13:57 ..
-rwxr-xr-x 1 gituser gituser 26 Jan 22 13:58 testy
:/home/gituser/git-shell-commands# ./testy
hello!
:/home/sodigit/git-shell-commands# cat testy
echo "hello!"
What am I doing wrong? How to run custom commands with git-shell?
COMMAND_DIR? – Daniel Hilgarth Jan 22 '13 at 14:41COMMAND_DIR. If you don't know to which directory it points, how can you place files in it? – Daniel Hilgarth Jan 22 '13 at 15:00