Update your username

Each username is unique throughout Bitbucket Cloud. Your username appears in the URL for your personal repositories, as in https://bitbucket.org/<username/<repository>. Other users can also use your username to search for you.

After updating your username, previous news associated with the account gets removed. Anyone else following you or your repositories loses updates from before the username change.

This page

Changing your username changes every URL that references your repositories. As a result, you (and anyone who references the old URL) must update the URL in your configuration files as well, or you won't be able to push to the repository. 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.

You can't convert an individual account to a Bitbucket team and vice versa. As an alternative, you can Transfer repositories and groups to your team to reassign existing repositories to a team.

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

Step 1. Update your username in Bitbucket

First, you change your username in Bitbucket.

  1. From your avatar in the bottom left, click Bitbucket settings.
  2. From the Account settings page, click change next to the Username.
  3. Enter your new Username.
  4. Click Rename.

You'll need to log out and log back in after making the change.

Step 2. Update the URL in your configuration file

The URL you use for a repository depends on which protocol you're using: HTTPS or SSH. You can find these URLs from the  Clone button on the Source page of your repository.

You can click back and forth between the SSH and the HTTPS protocol links to see how the URLs differ. The table below shows how the formats vary based on protocol.

You'll see these names as part of the URL:

  • In place of <repo_name>, you'll see the repository name.
  • In place of <your_username> in the HTTPS URL format, you'll see the username for your individual account.
  • In place of <account_name> for all URL formats, you'll the user or team name for the account that owns the repository.
    <your_username> and <account_name> may be the same if you're looking at the URL for a repository you own.
Git repository URLs
HTTPS format https://<your_username>@bitbucket.org/<account_name>/<repo_name>.git
SSH format




Mercurial repository URLs
HTTPS format https://<your_username>@bitbucket.org/<account_name>/<repo_name>
SSH format ssh://hg@bitbucket.org/<account_name>/<repo_name>/

Update the URL for Git repositories

  1. From a terminal, navigate to the repository.

    $ cd ~/<path_to_repo>
  2. Run git remote -v to see the current remote URL.

    $ git remote -v
    origin https://emmap1@bitbucket.org/tutorials/tutorials.git.bitbucket.org.git (fetch)
    origin https://emmap1@bitbucket.org/tutorials/tutorials.git.bitbucket.org.git (push)
  3. Update the remote URL with git remote set-url using the current and new remote URLs.

    $ git remote set-url origin git@bitbucket.org:tutorials/tutorials.git.bitbucket.org.git

If you update your URL from HTTPS to SSH, next time you push or pull from your repository, the terminal responds that it is adding the Bitbucket host to the list of known hosts. You also won't have to enter a password.

Update the URL for Mercurial repositories

  1. From your terminal, view your current repo configuration.
    You should see something similar to the following:

    $ cd ~/<path_to_repo>
    $ cat .hg/hgrc
    default = https://emmap1@bitbucket.org/emmap1/bitbucketspacestation

    In the previous example, the default URL is using the HTTPS protocol.

  2. Open the ~/<path_to_repo>/.hg/hgrc file with your favorite editor.
  3. Change the default value to the URL you want to use for that repository. When you are done you should see something similar to the following:

    default = ssh://hg@bitbucket.org/emmap1/bitbucketspacestation
  4. Save and close the configuration file.

If you update your URL from HTTPS to SSH, next time you push or pull from your repository, the terminal responds that it is adding the Bitbucket host to the list of known hosts. You also won't have to enter a password.

Last modified on Aug 1, 2017

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.