Build a Git repository in CentOS6 and a centos6git Repository

Source: Internet
Author: User

Build a Git repository in CentOS6 and a centos6git Repository

After Redmine was launched recently, the system integrated the Git linkage function, so I came up with the idea of building an intranet repository. I would like to record the following:

1. Install Git

yum -y install git

2. Create a user and password

useradd gitpasswd git

3. Create a repository

First switch the user to git

su git

Create a repository directory and initialize

mkdir test.gitcd test.gitgit --bare init

4. Configure the Public Key

Enable git RSA Authentication

vi /etc/ssh/sshd_config

Probably in the middle. If there are three sentences, you can cancel the comment.

RSAAuthentication yes     PubkeyAuthentication yes     AuthorizedKeysFile  .ssh/authorized_keys

Save and exit, copy the public key to be added, and create the public key document under the git main directory.

mkdir .ssh;chomod 700 .sshtouch .ssh/authorized_keyschmod 644 .ssh/authorized_keysvi .ssh/authorized_keys

Paste and save and exit

5. Set the user logon Mode

vi /etc/passwd

Change the line of git

git:x:500:500::/home/git:/usr/bin/git-shell

 6. obtain from the client

Create a local directory and execute

Git clone git @ ip: test. git # ip is your intranet address

This is a preliminary description. The content will be updated gradually as you use it.

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.