从本地计算机在远程服务器上创建 git 存储库

Creating a git repo on a remote server from a local machine

我有一个包含 GIT 存储库的 Debian 服务器。许多用户在通过 ssh 登录时被限制只能使用 "Git_Shell"。这些用户是否有可能以某种方式在远程服务器上启动新的存储库,原因是他们对他们尝试访问的目录具有写入权限?

比如说,Bruno 想在他的 /home/bruno 目录中创建一个新的存储库,当他被限制在 'git_shell' 时他会怎么做?

如“Git shell not enabled?”中所述,“help”应列出可用的命令。

这些仅限于用户目录 git-shell-commands 中的那些,您可以添加一个创建 git 存储库的目录。

文章“Hosting an admin-friendly git server with git-shell”添加:

it turns out that if you create a directory with this name in the Git user's home directory, any executable files you place inside the directory will become accessible through an interactive shell when you su up or SSH into the git user.
If you create a script named help, it will get executed when the shell starts.
Kind of cool, and really handy for making your Git server more friendly :-)