First step: Install git-dependent libraries #yum install Curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel gcc gcc-cc++
Step two: Install git download git-1.8.2.2.tar.gz install package to/usr/local/src/
# tar-zvxf/usr/local/src/git-1.8.2.2.tar.gz
# Cd/usr/local/src/git-1.8.2.2.tar
#./configure--prefix=/usr/local/git/
# Make && make install
When you are finished installing
#/usr/local/git/bin/git--version
Git version 1.8.3 indicates successful installation
# ln-s/usr/local/git/*/usr/bin/git/
Executing a git command anywhere can
Step three: Install git user management gitosis #yum install-y python python-setuptools
#cd/USR/LOCAL/SRC
#git Clone Git://github.com/res0nat0r/gitosis.git
#cd gitosis
#python setup.py Install
Show finished processing dependencies for gitosis==0.2 is successful
Fourth step: Add a user running the GIT service on Linux # useradd-c ' git version manage '-m-d/home/git-s/bin/bash git
# passwd git//Add password for git users
# su git switches to git user
Go to this step and skip to the fifth step and move back to the next steps.
# Gitosis-init </tmp/id_rsa.pub
The following information is displayed to indicate success
Initialized Empty Git repository in/home/git/repositories/gitosis-admin.git/
reinitialized existing Git repository in/home/git/repositories/gitosis-admin.git/
Linux git server has been successfully installed so far
Fifth step: Go back to our computer to generate GIT key username #ssh-keygen-t RSA//Run this command all the way to see the information to see the face
/*
Generating public/private RSA key pair.
Enter file in which to save the key (path/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? Y
Enter passphrase (empty for no passphrase):
Enter same Passphrase again:
Your identification have been saved in path/.SSH/ID_RSA.
Your public key have been saved in path/.ssh/id_rsa.pub.
The key fingerprint is:
71:5e:81:48:41:91:af:4c:74:bf:da:d8:9c:a6:d4:e9 [email protected]
*/
Uploading the generated id_rsa.pub file to the Linux git server/tmp/is the fourth step in the Gitosis-init </tmp/id_rsa.pub file
Fifth Step completed
Sixth step: Add and set up management projects in our computer to create files locally such as:
#mkdir repository/
#cd repository/
#git Clone [Email protected]:gitosis-admin.git
#cd repository/gitosis-admin.git/
Add other users to git with git other users use the fifth step to generate the Id_rsa.pub file and send it to you and do the following
View Id_rsa.pub file The name of the file with the value after "= =" for example: [email protected]
#cp [email protected] keydir/[email protected]
#vim gitosis.conf
Add the following at the end of the file
[Group Test-git] # set name with Write permission
writable = test-git # The group can write the project name
Members = [email protected] [email protected] #该组的成员 (key user name) when multiple users are co-developed, space-delimited
# If you want to increase the read-only group reference as follows
# [Group Test-git-readnoly] # Group name with permissions
# readonly = test-git # The group read-only project name
# members = [email protected] # member of the group
Seventh step: Commit to modify #git Add.
#git commit-a-M "Add test-git repo"
#git push
Installing a git server under centos6.4 Linux