Rename a Git repository in TFS 2015

TFS 2015 | VS 2017 | VS 2015

You can rename a Git repository in a team 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.


The steps in this article refer to TFS 2015. For VSTS and TFS 2017 and higher, see Rename a Git repository.

Rename the repo on the server

  1. Open a team project (on-premises http://{your_server}:8080/tfs/DefaultCollection/{your_project} or VSTS https://{your_account}{your_project}) in your web browser.

  2. Go to the control panel.

    Administer account

  1. Rename the repo from the Version Control tab.

    Rename a repository

Update the Git remotes on your dev machines

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 team project has been renamed, your remote references need to updated. This is due to the fact that the remote repository URL contains the team 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 team project. The instructions below show how to update the remotes for the Fabrikam Mobile repo that was renamed to Fabrikam.

Get the new URL for the repo

Copy the repository URL to your clipboard.

Remote URL for the repository

Update your remote in Visual Studio 2015 or 2017

  1. Connect to the repo.

    Connect to the repository

  2. Open the project settings.

    Project settings

  3. Open the repo settings.

    Repository settings

  4. Edit the fetch and push remote references and paste the URL that you copied from the remote repo.

    Edit remote

Update your remote in older versions of Visual Studio from the command prompt

If you use an older version of Visual Studio or work with Git from the command prompt:

  1. Open the Git command prompt.

  2. 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}

Refresh Team Explorer

  1. Refresh Team Explorer.

    Refresh Team Explorer

  2. Team Explorer now shows the updated repo name.

    Team Explorer Updated


Q: Can I rename my repo again? Can I re-use an old repo name?

A: Yes

Q: What if I named my remote something other than the default origin?

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}