Home > Development Tools > Git > body text

Detailed explanation of how to modify the path in Gitlab

PHPz
Release: 2023-04-03 13:50:56
Original
2200 people have browsed it

Gitlab is a popular code hosting platform used by many programmers to collaborate on code development. However, in the process of using Gitlab, sometimes we need to modify the project path. This article will introduce how to modify the path in Gitlab.

  1. Close the Gitlab service

Please close the Gitlab service before modifying the path. We can use the following command to shut down the Gitlab service:

sudo gitlab-ctl stop
Copy after login
  1. Backup data

Be sure to back up the data before modifying the path. This is an important step to keep your data safe. You can use the following command to back up data:

sudo gitlab-rake gitlab:backup:create
Copy after login

After the backup is completed, you can view the backup file in the directory where the backup file is stored (the default is /var/opt/gitlab/backups).

  1. Modify the path

Modifying the path of the Gitlab project requires modifying 3 configuration files ( is the new path):

  • gitlab.yml: Modify repositories.storagedir to /repositories
  • unicorn.rb: Modify unicorn:env to
  • rack_attack.rb: Modify Gitlab::Middleware: :Throttle::'/api/v3/internal/allowed' in GITLAB_API_PATTERN is '/api/v3/internal/allowed'

After modifying the above 3 files, please save and exit.

  1. Modify the warehouse storage path

Use the following command to update the Gitlab warehouse storage path:

sudo gitlab-rake gitlab:storage:update
Copy after login

After the update is completed, please start the Gitlab service:

sudo gitlab-ctl start
Copy after login
  1. Test path modification

After starting the Gitlab service, open the Gitlab website and test in one of the projects. If it can be accessed normally, the path modification is successful.

Summary

Through the above steps, we can easily modify the path of the Gitlab project. Before making modifications, be sure to back up your data to avoid data loss.

The above is the detailed content of Detailed explanation of how to modify the path in Gitlab. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!