title | titleSuffix | description | ms.assetid | ms.technology | ms.topic | ms.date | monikerRange |
---|---|---|---|---|---|---|---|
Rename a Git repo in TFS 2015 |
Azure Repos |
You can rename a Git repository in TFS 2015 in a few steps, but your team will have to take a few more steps to adapt to the change. |
05971618-4ea9-4997-bb51-2d74211352ef |
devops-code-git |
conceptual |
03/14/2018 |
>= tfs-2013 <= tfs-2015 |
TFS 2015 | VS 2017 | VS 2015
You can rename a Git repository in a project from your web browser. After you rename the repo, each member of your team will have to take a few steps to re-enable their dev machines to connect to the repo on the server.
Note
The steps in this article refer to TFS 2015. For Azure Repos and TFS 2017 and higher, see Rename a Git repository.
[!INCLUDE temp]
Git uses remote references to fetch and push changes between your local copy of a repository and the remote version stored on the server. After a Git repository or project has been renamed, your remote references need to updated. This is due to the fact 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.
Copy the repository URL to your clipboard.
-
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.
If you use an older version of Visual Studio or work with Git from the command prompt:
-
Open the Git command prompt.
-
Go to the local repository and update the remote to the URL you copied from the remote repo.
git remote set-url origin {URL_you_copied_from_the_remote_repo}
A: Yes
A: If you are using:
-
Visual Studio 2015 or 2017, then edit the remote with the name you used.
-
An older version of Visual Studio or the command prompt, then run this command:
git remote set-url {remote_name} {URL_you_copied_from_the_remote_repo}