Centos install git server centos 6.5 + git 1.7.1.0 + gitosis

Source: Internet
Author: User
Tags delete key ssh port

1. Install Extension

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel

2. Download git

wget http://codemonkey.org.uk/projects/git-snapshots/git/git-2014-08-24.tar.xz 

3. Unzip and install

Xz-D git-2014-08-24.tar.xz tar xvf git-2014-08-24.tar
CD git-2014-08-24make prefix =/usr/local/git allmake prefix =/usr/local/git install # Add soft connection ln-S/usr/local/git/bin/*/usr/bin /git -- version # How to display the version number, that is, the operation is successful.

3. Install gitosis

Yum install Python-setuptoolscd/usr/local/srcgit clone git: // pull gitosispython setup. py install # display finished processing dependencies for gitosis = 0.2 indicates successful

4. On the Development machine, generate the key and upload it to the server.

Ssh-keygen-t rsa # Press enter without a password # upload the public key to the server (default ssh port 22) # SCP ~ /. Ssh/id_rsa.pub [email protected] 192.168.1.225:/tmp or # SCP ~ /. SSH/id_rsa.pub [email protected]:/tmp/# For example, modify the ssh port (Port 8200) # git clone SSH: // [email protected]: 8200/gitosis-admin.git or # git clone SSH: // [email protected]: 8200/gitosis-admin.git # modify the configuration file, you can omit each input port Vim ~ /. Ssh/config # modify the client ~ /. In the ssh/config file, add the following code: Host www. domain. comhostname www. domain. comport 8200 # after modification, the client can be connected in the following way # git clone SSH: // [email protected]/gitosis-admin.git # upload the public key to the server (modify the port, and specify the port in the configuration) SCP ~ /. Ssh/id_rsa.pub [email protected]:/tmp/ls/tmp/id_rsa.pub # display the uploaded key

5. Generate git users on the server, use git users, and initialize gitosis

Adduser-M gitsu-gitgitosis-init </tmp/id_rsa.pub # The above information indicates success # initialized empty git repository in/home/git/repositories/gitosis-admin.git/# reinitialized existing git Repository in/home/git/repositories/gitosis-admin.git/# delete key Su-rootrm-RF/tmp/id_rsa.pub

6. Export Management on the Development Machine

mkdir -p /repocd /repogit clone [email protected]:gitosis-admin.git

7. Add and set management projects

CD/repo/gitosis-Admin # view uploaded keys ls keydircat keydir/vicowong \ @ Vico. pub # [email protected] is the Public Key generated by the uploaded developer # The final string of the key is displayed as the key user name. Here [email protected] Vim gitosis. conf # Add the following content at the end of the file [group test-Git] # group name writable = test-Git # project name members = [email protected] # key username # submit and modify git add. git commit-a-m "add Test-Git repo" Git push

8. Initially, add and use the project test-Git

cd /repomkdir test-gitcd test-gitgit intitouch readmegit add .git commit -a -m "init test-git"git remote add origin [email protected]:test-git.gitgit push origin master

 

Centos install git server centos 6.5 + git 1.7.1.0 + gitosis

Related Article

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.