Installing the GIT service on CENTOS7

Source: Internet
Author: User

Objective

At first, to install the Git service on Windows, tossing a day, in Copssh (win2008, Win7, win2003) always configuration is not successful, the final reactive and return, finally had to give up windows, and later have time to study.

Of course, there are other Windows version of the software available, such as Gitstack, Gitblit, and so on, do not want to engage in Windows edition, is not the limit is that problem, more trouble, so directly on the Linux version.

The following section is a Linux tool, referenced from http://blog.chinaunix.net/uid-15174104-id-3843570.html

In the area of GIT service management tools, there are three popular scenarios, namely:

gitosis -Lightweight, open source projects, using SSH Public key authentication, can only do library-level permissions control. Currently the project has ceased to develop and is no longer maintained.

Gitolite -Lightweight, open source projects, using SSH Public key authentication, can do branch-level permissions control.

Git + Repo + Gerrit -Super heavyweight, set version control, library management and code review. Can manage large and very large projects.

Note: In fact, there are many, such as: Gitlab, Gitblit, Gitbucket, Gogs, please refer to "Several git warehouse open source software comparison" http://dz.sdut.edu.cn/blog/subaochen/2016/01/ github_like_softwares/

Install Step 1 To install Git
Yum Install perl openssh git

Step 2 Build a git user and do the initial configuration
AddUser--system--shell/bin/sh --create-home--home-dir /home//home/git# Create a new directory, All repositories for git mkdir  repositories# set ownership chown git:git-r for this directory./repositories# Modify the operation permissions for this directory chmod ./repositories

Step 3 generates a pair of public key certificates (a blank password will return directly)
# can be generated directly on the server, it can also be generated locally, here I directly on the server generated.  Ssh-keygen -T rsa# finally generates two files, respectively id_ras.pub (public key) and Id_rsa (private key) # to move the public key to /home/git/. ssh/ directory, note that the public key file name is changed, the public key name corresponds to the user name configured in Gitolite, admin I used to do the system administrator's account name.  mv id_rsa.pub/home/git/. ssh/admin.pub# Id_rsa The private key to the C:\Users\Administrator\ of local windows using SFTP. ssh\ Directory, administrator is my login Windows account, you want to change to your own computer corresponding directory, for local git to log on to the remote server.

Step 4 Switch to the newly built git user, install Gitolite
sugitgit clone git://Github.com/sitaramc/gitolitemkdir-P $HOME/bin# Installation Gitolitegitolite/Install-to $HOME/bin# installation times wrong, according to the error hint, Baidu a few, install related dependenciesYum Install wget Perl-extutils-makemakerGCCwgethttp//www.cpan.org/modules/by-module/Data/Data-Dumper-2.154.tar.gzTarXvzf data-dumper-2.154.Tar. GZCD Data-dumper-2.154Perlmakefile.pl Make Make Install

Step 5 Configuration Gitolite
$HOME/bin/gitolite Setup-PK admin.pub# completed, in /home/git/repositories, Build two warehouses gitolite-admin.git and Test.git, one for the management of the warehouse and the other for testing; we can manage all the warehouses on the server by working on the Gitolite-admin.git warehouse.

Step 6 Management Gitolite
git clone [email protected]172.16. 13.229: gitolite-admin# After completion there are two directories, respectively, conf and keydir,conf/gitolite.conf is the user, warehouse permissions configuration, Keydir is to put the corresponding user's public key, After modifying the push back to the server, the management operation is completed.

below, let's use an example to show how to manage Git warehouses.

1. The original conf/gitolite.conf content is as follows:

Repo gitolite-admin    rw+     =   adminrepo testing    rw+     =   @all

2. Then we add the following content below the gitolite.conf content

@ android_group = Zhangsan lisirepo androidapp    RW+     =   @android_group

3, @ android_group = Zhangsan Lisi, defines the @android_group group, the group is Zhangsan and Lisi two people, of course, groups can also contain another group, people or groups separated by a space, we modified as follows:

@ android_group == = @android_group @ios_grouprepo androidapp    RW+     =   @ Android_grouprepo Appdoc    RW+     =   @ app_group

4, repo Androidapp, defined a Androidapp warehouse, the warehouse read and write permissions for @android_group, and finally push back to the server, we can be executed locally

git remote add origin [email protected]172.16. 13.229 : Androidapp.gitgit push Origin master

Two commands for the first time to push the local repository to the remote server repository, the next time there is a modification and push the direct git push.

Step 7 assigns a private key certificate to each child's shoe in the company

1. Generate Certificate

Ssh-keygen -t rsa–c "[email protected]"

2, the public key id_ras.pub renamed children's shoes name all spell, such as Zhangsan.pub, and copied to gitolite-admin warehouse Keydir directory;

3, the private key Id_rsa fly Q to the corresponding children's shoes;

4. Repeat 1 to 3 until all children's shoes are issued;

5, modify the gitolite.conf, configure the access rights of each project;

6, Push gitolite-admin modified content to the server;

7, the completion of the distribution work.

Note: The name of the person is all spelled as the public key file name, also gitolite.conf the name of the user; private key Id_rsa put the kids ' shoes on the C:\Users\Administrator\.ssh\ . directory.

Administrator is the system login name, if you are not the name, then change.

Of course, it is also possible for children's shoes to generate their own public key pair, and then unify the public key to me.

Using the GIT graphics client under Windows

1, install Windows git,https://git-for-windows.github.io/, download after the next installation can be.

2, install tortoisegit,tortoisesvn brother, https://tortoisegit.org/download/, is also a way next installation.

3, configuration Tortoisegit, reference other articles can, online articles or more, such as the following this write is very good http://blog.csdn.net/renfufei/article/details/41647937.

Installing the GIT service on CENTOS7

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.