79476128

Date: 2025-02-28 16:26:18
Score: 1
Natty:
Report link

To rename a repo on git that is cloned to your folder (project) on your local drive (with the same name of course) while preserving the connection between them follow these steps.

1- Rename your remote repo on GitHub/GitLab: Go to your repo settings → Rename it to

2- Rename the local folder on your machine directly on the folder name or in bash: mv

3- Now, in a local terminal go into the renamed local folder and update Git’s remote URL using: cd <path to the folder's new name> git remote set-url origin <new_repo_url>

Note: don't forget to replace <new_repo_url> with the new repo URL from GitHub/GitLab, which includes the updated name.

4- Finally, you might want to verify the connection is h: git remote -v

If it shows the correct new URL, we're all set!

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: fereidoun mianji