Home >Development Tools >git >Detailed explanation of how to modify the path in Gitlab

Detailed explanation of how to modify the path in Gitlab

PHPz
PHPzOriginal
2023-04-03 11:53:222459browse

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
  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

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

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

sudo gitlab-ctl start
  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!

Statement:
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