Rename your team

You can update your team name in Bitbucket, in your repository URLs, or in both places. If you update your name for the URL, you must update the URL in your configuration files as well, or you won't be able to push to the repository.

This page

Rename your team in Bitbucket

When you rename your team, you'll see that update the Teams dropdown, the Owner filter, and any other place you see your team's name in Bitbucket.

  1. Select your team name from Teams at the top.
  2. Click Manage team in the top right corner.
  3. Pick Team settings from the left side.
  4. Update your name in the Team Name text box.
  5. Click Update profile.

Update your team ID for repository URLs

Updating your URL is a two-part processYou update the Team ID in Bitbucket and then in your configuration file.

Step 1. Update the Team ID in Bitbucket

  1. From your team settings, click Change team ID on the left side.
  2. Enter your new Team ID. It might be a good idea to match your team name if you've updated that as well.
  3. Click Rename.

Changing the team name changes every Bitbucket URL that references the team's repositories. This change on the remote Bitbucket server invalidates any local repositories pointing to your repositories on Bitbucket. You and anyone who references the old URL in DVCS configuration files must update them to reflect the new account name. For example, if you rename your account from johnc to jcitizen, the repository previously available at http://bitbucket.org/johnc/repo is accessed as http://bitbucket.org/jcitizen/repo after renaming.

Step 2. Update the URL in your configuration file

If you don't update all configuration files that contain the old URLs, you'll get an error when attempting to push your repository. If you don't want to edit the configuration file, you can also clone the repository from the new location. Be aware that you will lose any changes you made but had not pushed up to Bitbucket before the repository was transferred.

  Show me an example of how different URLs look

If you start with the coolcode repository in your personal account named the thecodemeister, then you move the repository to your newaweteam team, here's what your URLs look like before and after:

  Before change After change
Git SSH format

git@bitbucket.org:thecodemeister/coolcode.git

or

ssh://git@bitbucket.org/thecodemeister/coolcode.git

git@bitbucket.org:newaweteam/coolcode.git

or

ssh://git@bitbucket.org/newaweteam/coolcode.git

Git HTTPs format https://thecodemeister@bitbucket.org/thecodemeister/coolcode https://newaweteam@bitbucket.org/newaweteam/coolcode
Mercurial SSH format ssh://hg@bitbucket.org/thecodemeister/coolcode/ ssh://hg@bitbucket.org/newaweteam/coolcode
Mercurial HTTPs format https://thecodemeister@bitbucket.org/thecodemeister/coolcode https://newaweteam@bitbucket.org/newaweteam/coolcode


Step 2a. Get your new URL

If you aren't sure what your new URL is, you can look it up from the command line:

  1. Navigate to your repository's directory in a terminal window.

    $ cd <path_to_repository>
  2. Run the following command from your terminal window:

    $ git remote -v

You should get something similar to one of the following results:

 

For SSH
origin    git@bitbucket.org:teamsinspace/documentation-tests.git (fetch)
origin    git@bitbucket.org:teamsinspace/documentation-tests.git (push)
For HTTPS
origin    https://dans9190@bitbucket.org/teamsinspace/documentation-tests.git (fetch)
origin    https://dans9190@bitbucket.org/teamsinspace/documentation-tests.git (push)

Step 2b. Change your URL locally

To change your URL in the configuration file, you can do it from the command line:

  1. Navigate to your repository's directory in a terminal window.

    $ cd <path_to_repository>
  2. To modify the fetch URL, run the following command from your terminal window:

     

    For SSH
    $ git remote set-url origin git@bitbucket.org:{new team or account name}/{repository name}.git
    For HTTPS
    $ git remote set-url origin https://{username}@bitbucket.org/{new team or account name}/{repository name}.git
  3. To modify the push URL, run the following command from your terminal window:

     

    For SSH
    $ git remote set-url --push origin git@bitbucket.org:{new team or account name}/{repository name}.git
    For HTTPS
    $ git remote set-url --push origin https://{username}@bitbucket.org/{new team or account name}/{repository name}.git

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport