GitLab is an open source application developed with Ruby on Rails that implements a self-hosted Git project repository that can access public or private projects through a web interface.
GitLab has similar functionality to Github, with the ability to browse source code, manage bugs and comments. It manages the team's access to the repository, it is very easy to browse committed versions and provides a file history repository. It also provides a code snippet collection function to easily reuse code and find it later when needed.
Basic environment preparation
yum install curl policycoreutils openssh-server openssh-clients postfix systemctl start postfix
Before starting postfix, you need to modify the configuration file /etc/postfix/main.cf
inet_interfaces = all
Install gitlab-ce
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh|bash yum -y install gitlab-ce
Configure and start gitlab
gitlab-ctl reconfigure
Enter the host IP to access the browser, and change the password for the first login
Log in as user root with the password you just set
Close registration
If you go to the login interface again, there will be no registration, and the system administrator will create a user
Create a user and project
Create a group first
You can select groups when creating a project
prompt no key
Create a file file
Add key id_rsa.pub
Use git clone to download the code in the directory where the code needs to be downloaded (the domain name resolution needs to be set first)
git clone [email protected]:web/web-demo.git
Then edit a document index.html in this directory and submit
git add * git commit -m "add index.html" git push
You can see it in the web interface
If you don't want to use a domain name but use ip access, you can modify the configuration file /etc/gitlab/gitlab.rb
external_url 'http://10.13.74.222'
After modification, the configuration needs to be re-executed