Create Bare Git Repository
Create bare git repository
$ mkdir some_project.git
$ cd some_project.git/
$ git --bare init
$ touch ./git-daemon-export-ok
Then, in local computer
$ git clone ssh://[git_user]@[domainname]/var/www/repository/some_project.git
Git-Shell
$ apt install git # git-shell also installed
$ cat /etc/shells # see if `git-shell` is already in there. If not...
$ which git-shell # make sure git-shell is installed on your system.
$ vi /etc/shells # and add the path to git-shell from last command
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/usr/bin/tmux
/usr/bin/screen
/usr/bin/git-shell # 👈 Add
$ sudo chsh git_only_user_name -s $(which git-shell)
# or
$ sudo chsh git_only_user_name # and enter the path to git-shell, usually: /usr/bin/git-shell
$ ssh git_only_user_name@gitserver
fatal: Interactive git_only_user_name shell is not enabled.
hint: ~/git-shell-commands should exist and have read and execute access.
Connection to gitserver closed.
See: from You can easily restrict the git user account to only Git-related activities
on https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server
Misc.
[ Bare Git Repository ]
http://kovshenin.com/archives/howto-remote-shared-git-repository/
http://namhyung.springnote.com/pages/3132772
[ Git-Shell ]
https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server
https://git-scm.com/docs/git-shell
https://git-scm.com/book/ja/v2/Gitサーバー-サーバーのセットアップ
독자 의견
저자 @richard 에게 의견 남기기: