Rename or convert an account

You can rename or delete an account or team.  This page contains the following topics:

Though teams are not accounts, renaming a team has most of the same impacts and follows the same procedures.

Renaming an Account

You rename a Bitbucket Cloud account by selecting the Change username option on the Bitbucket Account screen. Renaming your account is the same thing as changing your user or team name.

Changing the account's user/team name changes every URL that references the account's repositories. This change on the remote Bitbucket server invalidates any existing URL pointing to your repositories from user's local repositories. You and anyone who references the old URL in DVCS configuration files must update the [paths] section 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 the rename. 

Renaming an account resets the account's newsfeed. Previous news associated with the account is deleted. Any followed projects, people and so forth are not preserved.

Updating Configuration Files after a Rename

After changing the ownership of a repository, you must update any configuration files that contain the old URLs.

If you don't do this, you will get an error attempting to push your repository to the Bitbucket server. For Git, this error looks similar to the following:

git push
Password: 
fatal: https://newowneract@bitbucket.org/newowneract/coolcode.git/info/refs not found: did you run git update-server-info on the server?

The exact error message you get depends on which protocol you are using to access the repository. To fix this problem, you can edit the repository URL in your repository's configuration file.

  Show me how the different URLs look

The following table illustrates a repository location under the various protocols before and after a transfer. For example, if your username is thecodemeister and the repository's name is coolcode, the URLs used to access the repository are the following:

  SSH format URL HTTPs format URL
Git

git@bitbucket.org:thecodemeister/coolcode.git

or

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

https://thecodemeister@bitbucket.org/thecodemeister/coolcode 

Mercurial ssh://hg@bitbucket.org/thecodemesiter/coolcode/

https://thecodemesiter@bitbucket.org/thecodemesiter/coolcode

If you transfer the repository to a new team called, newowneract, the new URLs will look like this:

  SSH format URL HTTPs format URL
Git

git@bitbucket.org:newowneract/coolcode.git

or

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

https://newowneract@bitbucket.org/newowneract/coolcode 

Mercurial ssh://hg@bitbucket.org/newowneract/coolcode/

https://newowneract@bitbucket.org/newowneract/coolcode

Get the current remote URL information for your Git repository

  1. Navigate to your repository's directory in a terminal window using the command cd path/to/your/repository.
  2. Run the following command from your terminal window:
git remote -v

This should give you 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)
If you don't want to edit the configuration file, you can also simply clone the repository from the new location. Be aware that you will lose any changes you made but had not pushed up to the remote (Bitbucket) before the repository was transferred.

Modify your Git remote URLs

You will need to know if you're using SSH or HTTPS before changing your URLs. If you are unsure which method you're using you can find your remote URLs.

  1. Navigate to your repository's directory in a terminal window using the command cd path/to/your/repository.
  2. Run the following command (which modifies the fetch URL) 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. Run the following command (which modifies the push URL) 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

Converting a team to an Individual Account

You cannot convert a Bitbucket team to an individual account. You can give another Bitbucket user administrator permissions to a team and have them remove you, which effectively removes your ownership of the team. 

Converting an Individual Account to a team

You cannot convert an individual account to a Bitbucket team. You can create a Bitbucket team from your individual account, invite users to the team, and then Change or transfer repository ownership to reassign existing repositories to the team. For more information on teams see, Bitbucket Cloud Teams.

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