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.