Private git repository step via SSH in Linux

Source: Internet
Author: User
Tags ssh git clone

On a Linux server

The first step is to create an account that is specific to Git's warehouse, which is also easy to manage. You can refer to the Linux New User command for this article.

#新建一个git用户组
sudo groupadd git

#新建一个git用户, create a directory, and prevent shell logins from being added to the GIT user group

sudo useradd git-m-s/sbin/nologin-d/home/git-g git

The second step is to create a new git warehouse, called Git bare repository, which is the repository for git.


$ mkdir Repo.git
$ chown-r git:git repo.git #改权限
$ CD Repo.git
$ git--bare init
Initialized empty Git repository in/home/ams/repo.git/

This warehouse is not the same as the local one, you can find that the local warehouse has a. Git directory under Project, and Project has its own code. But this git bare warehouse it doesn't have its own project, and he only has the same content as the local. Git directory.

Under the client

Using the Tortoisegit graphical interface, use the portable git kernel.

The first step, right-click Directory, select Git clone, and then set as diagram


The second step, after the confirmation, will come out a password prompt box, lets enter the password.

The third step is to wait for the download to end so that there is a local repository locally.

Summary: Such a simple git private warehouse is built, local can continue to submit code to the server, but also requires a password.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.