NAME
git-server - Secure Git Server with more granular hooks capabilities than default git.
SYNOPSIS
Standard Method:
With SHELL=/bin/bash, use the following format in ~/.ssh/authorized_keys:
command="/path/to/git-server REMOTE_USER=user1" ssh-ed25519 AAAA_OAX+blah_pub__ user1@workstation
-- OR --
Advanced Method:
Set SHELL=/path/to/git-server (in /etc/passwd) and
Add /path/to/git-server to /etc/shells and
Set "PermitUserEnvironment yes" (in /etc/ssh/sshd_config)
Then use the following format in ~/.ssh/authorized_keys:
environment="REMOTE_USER=user1" ssh-ed25519 AAAA_OAX+blah_pub__ user1@workstation
ENV
You can set as many %ENV variables as you want within the authorized_keys configuration.
REMOTE_USER
REMOTE_USER has a special meaning to define a word for the associated user. You may use the same REMOTE_USER for those who have multiple PubKeys. This REMOTE_USER will be used for ACL rules.
INSTALL
This can be used with any existing git repositories or as a drop-in replacement for git-shell or you can create a fresh repo on the git host:
git init --bare project
Then add hooks/run-git-hooks to override the default behavior:
vi project/hooks/run-git-hooks
chmod 755 project/hooks/run-git-hooks
If hooks/run-git-hooks exists from within the repository being targeted, then this will run with the correct GIT_DIR and any other ENV settings defined in authorized_keys. If it doesn't exist, then it will look for a way to use these git-server hooks with this project.
SEE ALSO
Similar functionality to the following:
gitlab-shell, gitolite, git-shell
AUTHOR
Rob Brown <bbb@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2015-2026 by Rob Brown <bbb@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.