Install gitlab to the project and upload a solution

1. Install

 docker pull gitlab/gitlab-ce:15.4.2-ce.0

1.1 Create a mount directory

mkdir -p /app/gitlab

1.2 start

docker run -d  \
-p 4433:443 \
-p 8060:8060 \
-p 222:22 \
--name gitlab \
--restart always \
-v /app/gitlab/config:/etc/gitlab \
-v /app/gitlab/logs:/var/log/gitlab \
-v /app/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:15.4.2-ce.0

1.3 configure gitlab

Go to /gitlab/config to modify gitlab.rb

cd  /app/gitlab/config
vim  gitlab.rb  

add content

#配置clone地址
 external_url 'http://139.196.170.222:8060'
 #配置用户邮箱
 gitlab_rails['smtp_enable'] = true
 gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"
 gitlab_rails['smtp_port'] = 25
 gitlab_rails['smtp_user_name'] = "[email protected]"
 gitlab_rails['smtp_password'] = " yb@123"
 gitlab_rails['smtp_domain'] = "qq.com"
 gitlab_rails['smtp_authentication'] = "login"
 gitlab_rails['smtp_enable_starttls_auto'] = true
 gitlab_rails['smtp_tls'] = false
 gitlab_rails['smtp_pool'] = false
 gitlab_rails['gitlab_email_from'] = '[email protected]'
 user['git_user_email'] = "[email protected]"

Restart the docker image

docker restart gitlab

View the initial password of the docker admin account

sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password

Enter the page localhost:8060, the default username of the administrator isadmin

insert image description here

Register as a normal user

2.1 Enter registration

http://ip:8060/users/sign_in

insert image description here

2.2 Approval by logging in to admin after creation

insert image description here

#3.1 Create a project

3.2 Step 1

insert image description here

3.2 Step 2

insert image description here

3.3 Step 3

insert image description here

3.4 Add members to the project

insert image description here
confirm
insert image description here

4 Use member users to upload to the newly created project

4.1 Copy project address

insert image description here

4.2 Use git here to clone the project

git clone url

insert image description hereEnter the password
insert image description hereclone to complete
insert image description here

4.3 Go to the download directory and copy the code to the newly downloaded git file

insert image description here

4.4 Submit to local

 #进入新下载的git文件目录
cd /path 
#  命令的含义为把该文件夹下的所有文件均添加到git
git add  .
# 提交 注释为 Initial commit
git commit -m "Initial commit"

insert image description here

4.5 Upload to remote git repository

git push

insert image description here

4.5 View Results

insert image description here

Guess you like

Origin blog.csdn.net/qq_46645840/article/details/129205630