New to Bitbucket Cloud? Check out our get started guides for new users.
Change a workspace ID
Changing your workspace ID will change the URL for all associated repositories, snippets, and any static websites you're hosting on Bitbucket Cloud.
A workspace is how you organize different streams of work in an account. You can change your workspace ID in Bitbucket Cloud; however, this will change the URLs for all the repositories, snippets, and static websites you're hosting on Bitbucket Cloud.
Change your workspace ID for repository, snippet, wiki, and website URLs
Changing your URL is a two-part process. You first update the workspace ID in Bitbucket Cloud and then in your configuration file.
Update the workspace ID in Bitbucket Cloud
From your profile avatar, select the workspace you want to update or All workspaces for a list of all your workspaces.
Select Settings on the left sidebar navigation of the workspace.
Select (change) to the right of your workspace ID.
Enter your new workspace ID. Your workspace ID can only contain lowercase letters with no spaces or special characters.
View the repositories that will be impacted to confirm you understand the impact of this change.
Follow the prompts to confirm the change.
Update any configuration files, builds, or references to the old URLs.
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 workspace ID.
For example, if you rename your workspace ID from johnc to jcitizen, the repository previously available at http://bitbucket.org/johnc/repo is accessed as http://bitbucket.org/jcitizen/repo after renaming.
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 move 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 <workspace_ID> in the HTTPS URL format, you'll see the workspace ID for your workspace.
Git repository URLs
Mercurial repository URLs
Update the URL for Git repositories
From a terminal, navigate to the repository.
$ cd ~/<path_to_repo>
Run git remote -v to see the current remote URL.
$ git remote -v
origin https://email@example.com/tutorials/tutorials.git.bitbucket.org.git (fetch)
origin https://firstname.lastname@example.org/tutorials/tutorials.git.bitbucket.org.git (push)
Update the remote URL with git remote set-url using the current and new remote URLs.
$ git remote set-url origin email@example.com:tutorials/tutorials.git.bitbucket.org.git
If you update your URL from HTTPS to SSH, the 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
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://firstname.lastname@example.org/emmap1/bitbucketspacestation
In the previous example, the default URL is using the HTTPS protocol.
Open the ~/<path_to_repo>/.hg/hgrc file in your favorite text editor.
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:
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.
Was this helpful?