Renaming a Bitbucket Repository

Bitbucket is a paid-for version of Github. Along with Jira and Confluence, it forms the Atlassian framework, a suite of devops tools in widespread use.

Using the Bitbucket web interface, a repository can easily be renamed. However, this causes a change in the URL, which breaks the link from existing clones of the repo. They can be deleted and re-cloned, or renamed. This post explains how to do the rename.

1. Rename the Repository in Bitbucket

In a browser, log into Bitbucket and surf to the repository of interest. Click the gearwheel button on the left (“Repository settings”) and do a simple rename. For this example, I took a repo called “ansible-roles” and changed its name to “orchestration“.

2. Rename any Cloned Copies

The above breaks the URL configured into the cloned copy on my local machine. Check the URL with “git config –list”. It can be seen that the local git is still pointing to the old name:

$ git config --list

Update the local repo with “git remote set-url”:

$ git remote set-url origin

A final check confirms the change:

$ git config --list


The Atlassian Bitbucket version was v5.5.0. Local git version was 2.1.4, running on Debian 8.9.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.