title | titleSuffix | description | ms.assetid | ms.service | ms.topic | monikerRange | ms.date | ms.subservice |
---|---|---|---|---|---|---|---|---|
Rename a Git repo in your project |
Azure Repos |
You can rename a Git repository in a few steps. Your team will have to take a few more steps to adapt to the change. |
05971618-4ea9-4997-bb51-2d74211352ef |
azure-devops-repos |
conceptual |
<= azure-devops |
02/23/2022 |
azure-devops-repos-git |
[!INCLUDE version-lt-eq-azure-devops] [!INCLUDE version-vs-gt-eq-2019]
You can rename a Git repository in a project from your web browser. After you rename the repo, each member of your team should take a few steps to re-enable their dev machines to connect to the repo on the server.
- To rename a repository, you must have Rename Repository permissions on your Git repo. ::: moniker range=">= azure-devops"
- If you want to use az repos update command to rename a repository, be sure to follow the steps in Get started with Azure DevOps CLI. ::: moniker-end
::: moniker range=">= azure-devops-2019"
-
From the web portal, select Repos, Files.
-
From the repo drop-down, select Manage repositories.
-
Select the name of the repository from the Repositories list, choose the ... menu, and then choose Rename repository.
-
Rename the repository by typing the repo's new name and selecting Rename.
::: moniker-end
::: moniker range="azure-devops" [!INCLUDE az-repos-update]
::: moniker-end
[!INCLUDE temp]
Git uses remote references to fetch and push changes between your local copy of a repository and the remote version that is stored on the server. After a Git repository or project has been renamed, you should update your remote references. Update your references to that the remote repository URL contains the project and the repository name.
Each member of your team must update their local Git repos to continue connecting from their dev machines to the repo in the project. The instructions below show how to update the remotes for the Fabrikam Mobile repo that was renamed to Fabrikam.
::: moniker range=">= azure-devops-2019"
-
Select Repos, Files.
-
Select Clone in the upper-right corner of the Files window and copy the clone URL.
::: moniker-end
To update your remote:
-
In the Git menu from the menu bar, select Manage Remotes.
-
In the Options dialog, select the remote to edit, then select Edit.
:::image type="content" source="media/repo-rename/options-rename-remote.png" border="true" alt-text="Screenshot shows the Options dialog with the option to edit remotes." :::
-
Replace the fetch and push remote references with the URL that you copied from the remote repo.
-
Select Save and then OK to close the Options dialog.
Visual Studio 2019 version 16.8 and later versions provides a Git version control experience while maintaining the Team Explorer Git user interface. To use Team Explorer, uncheck Tools > Options > Preview Features > New Git user experience from the menu bar. You can exercise Git features from either interface interchangeably.
To update your remote from Visual Studio Team Explorer:
-
Connect to the repo.
-
Open the project settings.
-
Open the repo settings.
-
Edit the fetch and push remote references and paste the URL that you copied from the remote repo.
A: Yes