Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a gitolite server

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to build a gitolite server, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Create git users and groups on the server

Groupadd-g gid gituseradd-u uid-g gid-d / home/git git passwd git

Generate server public and private key pairs

Ssh-keygencp id_rsa.pub gitadmin.pub

Download the gitolite source code

Cd / home/gitgit clone git@github.com:sitaramc/gitolite.git

View the documentation

Vim README.markdown

Create a gitolite installation directory

Mkdir-p $HOME/bin

Installation

Gitolite/install-to $HOME/bin

Set environment variable (CentOS)

Vim .bashrc export GITOLITE_HOME=/home/git/ export PATH=$PATH:$GITOLITE_HOME/bin

Set the server locally to the gitolite management account

Gitolite setup-competitive YourName.pub

At this point, the repositores directory appears under the / home/git directory.

Set the source code library and permissions in the gitolite-admin library under clone on the server

Git clone git@www.testhost.com:gitolite-admin.git

Add a normal user

Developers or other people who need to access the git source library run on their own computers

Ssh-keygen

Upload the generated pub file to the gitolite-admin library after changing the file name, and upload the pub file to the keydir directory. In addition,

Modify the gitolite.conf file in the conf directory in the following format:

@ admin=gitadmin@dev=gitadmin dev01 dev02 dev03 @ hudson=hudson01@third=third01 third02 third03repo gitolite-admin RW+ = @ adminrepo testing RW+ = @ allrepo repoone RW+ = @ dev @ admin R = @ hudsonrepo repotwo RW+ = @ dev @ adminrepo path/.+ C = @ admin RW+ = @ dev @ admin R = @ hudsonrepo mail RW+ = @ devrepo Dev/.+ C = @ dev RW+ = @ dev R = @ hudsonrepo path2/path3/path4/.+ R = @ third RW+ = @ third-master develop V1.0.0 V2.0.0 = @ third

The above files have functions such as user grouping, source code library, path matching (path2/path3/path4/.+), branch permission control (- master develop V1.0.0 V2.0.0) and so on.

Remarks

Password-free login settings for SSH and SFTP

After the SSH client runs ssh-keygen to generate the public key, run the command to send the public key file to the remote server

Is it helpful for you to read ssh-copy-id-I / .ssh/username.pub git@www.testhost.com after reading the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report