Git configuration (ii) Windows installs Git and configures CentOS as a remote repository

Source: Internet
Author: User

1. Create a git user for the CentOS system

useradd -d /home/git git      #创建git用户passwd git                           #修改密码

2. Open the CentOS system RAS Certification

vim /etc/ssh/sshd_config

Open the following comment and modify it as follows

3, download the Windows version of the GIT installation software, according to the operating system select 32-bit or 64-bit

https://git-scm.com/download/win

4, install Git, always next
5. Build SSH key for Windows, right-click on the directory point, choose Git Bash here, enter the following command on the Open command line to confirm

ssh-keygen -t rsa -C "[email protected]"

6. Upload SSH key to the CentOS system and enter the following command in the Windows git bash

ssh [email protected] ‘cat >> .ssh/authorized_keys‘ < ~/.ssh/id_rsa.pub

After successful check the CentOS system/home/git/.ssh/directory to generate the Authorized_keys file, and whether the file has the Id_rsa.pub public key content of Windows, the file is located in the C:\Users\xxx.ssh directory
7. Create a repository in the CentOS system

su gitcd /home/git/mkdir repositorycd repositorymkdir test.gitgit init --bare test.git

8, prohibit git users to login shell, subsequent creation of the repository can be created by the root user, created chown for git users

vim /etc/passwd


9. Through the Windows Remote clone Repository, create a directory to clone in Windows, open git Bash, enter

git initgit clone [email protected]:/home/git/repository/test.git

Git configuration (ii) Windows installs Git and configures CentOS as a remote repository

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.