Setup and Config
Getting and Creating Projects
Basic Snapshotting
Branching and Merging
Sharing and Updating Projects
Inspection and Comparison
Patching
Debugging
External Systems
Server Admin
- 2.18.1 → 2.45.2 no changes
- 2.18.0
06/21/18
- 2.11.4 → 2.17.6 no changes
- 2.10.5
09/22/17
- 2.9.5
07/30/17
- 2.1.4 → 2.8.6 no changes
- 2.0.5
12/17/14
RESUMO
chsh -s $(command -v git-shell) <usuário> git clone <usuário>@localhost:/path/to/repo.git
ssh <usuário>@localhost
DESCRIÇÃO
This is a login shell for SSH accounts to provide restricted Git access. It permits execution only of server-side Git commands implementing the pull/push functionality, plus custom commands present in a subdirectory named git-shell-commands
in the user’s home directory.
COMANDOS
git shell aceita os seguintes comandos após a opção -c
:
- git receive-pack <argumento>
- git upload-pack <argumento>
- git upload-archive <argumento>
Chame o comando correspondente do lado do servidor para apoiar a solicitação do comando git push, git fetch ou git archive --remote do cliente.
- cvs server
Imitate a CVS server. See git-cvsserver[1].
Caso um diretório ~/git-shell-command
estiver presente, o comando git shell também manipulará outros comandos personalizados executando "git-shell-commands/<comando> <argumentos>
" no diretório inicial do usuário.
USO INTERATIVO
É predefinido que os comandos acima possam ser executados apenas com a opção -c
; o shell não é interativo.
If a ~/git-shell-commands
directory is present, git shell can also be run interactively (with no arguments). If a help
command is present in the git-shell-commands
directory, it is run to provide the user with an overview of allowed actions. Then a "git> " prompt is presented at which one can enter any of the commands from the git-shell-commands
directory, or exit
to close the connection.
Em geral, este modo é utilizado como uma interface administrativa para permitir que os usuários listem os repositórios dos quais eles têm acesso para, criar, excluir ou renomear os repositórios ou alterar as descrições e permissões do mesmo.
Caso um comando no-interactive-login
existir, ele será executado e o shell interativo será abortado.
EXEMPLOS
Para desativar os logins interativos, exibindo uma saudação:
$ chsh -s /usr/bin/git-shell $ mkdir $HOME/git-shell-commands $ cat >$HOME/git-shell-commands/no-interactive-login <<\EOF #!/bin/sh printf '%s\n' "Olá $USER! Você se autenticou com sucesso, porém eu não" printf '%s\n' "forneço um acesso interativo ao shell." exit 128 EOF $ chmod +x $HOME/git-shell-commands/no-interactive-login
Para ativar o acesso ao git-cvsserver (que geralmente deve ter o exemplo no-interactive-login
acima como pré-requisito, pois a criação do diretório git-shell-commands permite logins interativos):
$ cat >$HOME/git-shell-commands/cvs <<\EOF if ! test $# = 1 && test "$1" = "server" then echo >&2 "git-cvsserver lida apenas com \"server\"" exit 1 fi exec git cvsserver server EOF $ chmod +x $HOME/git-shell-commands/cvs
VEJA TAMBÉM
ssh(1), git-daemon[1], contrib/git-shell-commands/README
GIT
Parte do conjunto git[1]