I have a server with a dedicated git
user and repositories
I'm trying to use the git-shell
method to allow my devs to work on several projects.
I'm about to change the shell of my git
user to git-shell
If I do that, I won't be able to connect with a standard shell anymore (that's the idea).
Question: So how will I create new repositories ?
Will I have each time to connect with a sudoer and create the repo then chown it ?
You can use a
git-shell-commands
directory to extendgit-shell
with custom commands, these can then be remotely executed using ssh.For example create
~git/git-shell-commands/newgit
with this content:Then
chmod +x ~git/git-shell-commands/newgit
to allow execution.To use it, run:
this is enough to create a new bare git repository, it can be cloned using:
Have look at http://planzero.org/blog/2012/10/24/hosting_an_admin-friendly_git_server_with_git-shell
You can create a git-shell-commands directory in your git user's home directory, then copy in the sample tools from the page to allow creating repo via guest-shell.
Yes, you can see an example in the article "Git Local Repository Setup Guide" by Rami Al-Ghanmi (
alghanmi
):Repository Setup & Essentials
Create a HelloWorld Repository