Kudos
Collect
Twiiter
Facebook
Share
Develop somethings, meditation, reading and thinking...

Create Bare Git Repository

Last updated over 5 years ago
0 0 0 0

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サーバー-サーバーのセットアップ

Hi, my name is Richard. I’m a developer wants to make the world better with logic power. Mainly I use Linux, Nginx, MySQL, PHP and JavaScript . I want to share my knowledge with someone that it was also based from some great persons via LYNMP. 👨‍💻

Essedrop - Make your file online instantly
 

Responses

Leave a response to @richard

Please sign in to comment.
Markdown is also available in comment.