Build git remote warehouse based on ssh protocol on linux

1. Server:
1.1. Install git
yum install git
1.2. Create a bare warehouse without a workspace
mkdir /my_project.git
cd /my_project.git
git init --bare //This command can also be modified by adding the --shared option The group permission for this repository directory is writable.
2. Client:
2.1. Clone to this machine, the url uses the ssh protocol format
git clone root@serviceIpAddress:/my_project.git

If the user specified by the url has writable permissions to the my_project directory, he will automatically have push permissions.

Summary: As long as you add an account that can log in with SSH on the server , and then put the bare repository in a place where everyone has read and write permissions, such a remote repository is configured.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325322549&siteId=291194637