Set up git server gitosis under CentOS6.2

Source: Internet
Author: User

Set up git server gitosis under CentOS6.2
1. Install git
Check whether [plain] view plaincopy has been installed in git.

  1. [Root @ localhost ~] # Rpm-qgit
If not, install [plain] view plaincopy.
  1. [Root @ localhost ~] # Yuminstallgit

After the installation is complete, test whether the installation is successful.

[Plain] view plaincopy
  1. [Root @ localhost ~] # Git -- version

If the following information is displayed, the installation is successful.
Git version 1.7.1

2. Set the git Server

Create a git server to Manage Users

[Plain] view plaincopy
  1. [Dengsilinming @ localhost ~] $ Sudouseradd-mgit
  2. [Dengsilinming @ localhost ~] $ Sudopasswdgit

Create a git repository directory

[Plain] view plaincopy
  1. [Dengsilinming @ localhost ~] $ Sudomkdir/home/git/repositories
Set git repository Permissions
[Plain] view plaincopy
  1. [Dengsilinming @ localhost ~] $ Sudochowngit: git/home/git/repositories
  2. [Dengsilinming @ localhost ~] $ Sudochmod755/home/git/repositories
Initialize global settings [plain] view plaincopy
  1. [Root @ localhost ~] # Gitconfig -- globaluser. name "linming"
  2. [Root @ localhost ~] # Gitconfig--globaluser.emaillinming@126.com
Install python's setup tool [plain] view plaincopy
  1. [Root @ localhost ~] # Yuminstallpython-setuptools
  2. [Dengsilinming @ localhostgitosis] $ gitclonegit: // eagain.net/gitosis.git
If [plain] view plaincopy appears
  1. Eagain.net [0: 208. 78.102.120]: errno = Connectionrefused
  2. Fatal: unabletoconnectasocket (Connectionrefused)
Unable to download (This occurs because the proxy is not configured online) Please try: [plain] view plaincopy
  1. [Dengsilinming @ localhosttmp] $ gitclonehttps: // github.com/res0nat0r/gitosis.git
After the download is successful: [plain] view plaincopy
  1. [Dengsilinming @ localhosttmp] $ cdgitosis
  2. [Dengsilinming @ localhostgitosis] $ sudopythonsetup. pyinstall
Generate a public key on the development machine (the user on the development machine acts as the git server administrator)
[Plain] view plaincopy
  1. [Dengsilinming @ localhostgitosis] $ ssh-keygen-trsa # always press Enter.
  2. [Dengsilinming @ localhostgitosis] $ scp ~ /. Ssh/id_rsa.pub/tmp/& chmoda + r/tmp/
  3. [Dengsilinming @ localhostgitosis] $ sugit
  4. [Dengsilinming @ localhostgitosis] $ sudo-H-ugitgitosis-init </tmp/id_rsa.pub
Gitosis manages configuration files through a git repository, which is placed in/home/git/repositories/gitosis-admin.git. We need to add executable permissions to a file:
[Plain] view plaincopy
  1. [Root @ localhost ~] # Chmod755/home/GitHub/repositories/gitosis-admin.git/hooks/post-update
Now the server has been built.

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.