Centos install git version management tool


 yum -y install gcc
 
 yum install zlib-devel.x86_64

 yum install curl-devel
 
wget --no-check-certificate  https://www.kernel.org/pub/software/scm/git/git-2.10.2.tar.xz

 xz -d git-2.10.2.tar.xz
 
  tar xvf git-2.10.2.tar
   cd git-2.10.2
   ./configure
   make && make install
   
   
  $ whereis git
git: /usr/local/bin/git
$ git  --version
git version 1.7.6
$ git  --help

[root@localhost opt]# git config --global user.name "admin"
[root@localhost opt]# git config --global user.email "[email protected]"
[root@localhost opt]# git config --list
user.name=admin
[email protected]
[root@localhost opt]#

groupadd git
useradd git -g git
passwd git //modify password

Install the GIT user management tool Gitosis

 yum install python-setuptools.noarch
 
git clone https://github.com/tv42/gitosis.git
“Unable to find remote helper for 'https'” during git clone

 sudo -H -u git gitosis-init < ~/id_rsa.pub
OSError: [Errno 2] No such file or directory
 find / -name post-update
  chmod 755 /usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/templates/admin/hooks/post-update
  
  Initialize the gitosis management repository and import the administrator's public key
 sudo -H -u git gitosis-init < ~/id_rsa.pub
 
 Check out the git repositories that gitosis uses for management
 cd /home/git/repositories/
 
 
 Use the git client to download the Git repository for management
 
 ssh://[email protected]:4231/gitosis-admin.git
 
 gitosis.conf
 [gitosis]

#Administrative GIT directory
[group gitosis-admin]
writable = gitosis-admin
members = admin

[group liuliangbao_agent]
writable = someServierFolder #Corresponding to a directory under /home/git/repositories/ on the server, automatically generated, no need to manually create
members = testuser1 testuser2 #Multiple users separated by spaces


The keydir puts the pub.key value, and the file name must be the same as the name in members
You can use puttygen.exe to generate a public-private key pair and issue it to everyone
testuser1.pub
testuser2.pub

 
 
Then commit -->commit and push
 




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326138708&siteId=291194637