Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename Gitlab repository name using API

Tags:

git

gitlab

I have created several repositories in GitLab.Now I want to rename or remove repository. How can I do this? is there any API available? or is there any git command available for this?

like image 937
Harsh Patel Avatar asked Feb 04 '26 07:02

Harsh Patel


2 Answers

To rename a repository on GitLab:

  1. Navigate to your project's Settings > General > Advanced settings.
  2. Under "Rename repository", change the "Path" to your liking.
  3. Hit Rename project.
like image 177
midi Avatar answered Feb 06 '26 00:02

midi


GitLab latest (Tested version V16.8.X)

To rename repository and remote URL, Go to relevant project,

  • Setting -> General -> Project name -> Edit the project name -> Save changes
  • Setting -> General -> Project name -> Advanced -> Change path -> Edit the path -> Change path

This will changed the remote repository and need to update local repository.

  1. Copy the new URL from remote repository.
  2. Open preferable terminal(ex: gitbash) in local project root.
  3. Execute git remote set-url origin <new-url>
  4. Verify the updated remote URL with git remote -v
like image 38
Dinushika Rathnayake Avatar answered Feb 05 '26 23:02

Dinushika Rathnayake



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!