The easiest way to rename a git project configured on BitBucket

I have a project hosted on BitBucket

Can I rename it?

If not, and I need to create a new repository, someone can tell me the easiest way to do this and have a new BitBucket repo (one of the reasons for the confusion for me is whether to manage the process locally or from the bitbucket website)

Update

Thankyou Rafal I followed your instructions and it works fine, but I'm just going to make it a little clearer for noobies like me (on Linux)

  • Rename the project in the Bitbucket project settings
  • vi projectname / .git / config and change the url value to reflect the new bitbucket repository url
  • mv projectname newprojectname
+50
git bitbucket
Aug 26 '14 at 14:10
source share
3 answers

You can rename the project from the project settings menu on Bitbucket.

After renaming it, you need to update the git configuration file to retrieve data from the new location

nano .git/config 

Change the project name to a new name and save

+59
Aug 26 '14 at 14:13
source share
— -

I think this is the easiest way:

  • Rename your project from the bitbuck settings menu
  • Clone a recently renamed project
    • git clone new_url

This works because git is a distributed version control system. As for git, there is nothing special about an existing repo on your computer. Just clone the new one.

If you prefer to use an existing local repo, in my opinion, it is easier to use git to update itself, instead of manually editing the configuration file:

  • Rename your project from the bitbuck settings menu
  • Change directory in local project and upgrade git to extract data from recently renamed repo
    • git remote set-url origin new_url
  • Optional (git doesn't matter) rename the local project directory
    • mv projectname newprojectname
+11
Aug 01 '15 at 5:42 on
source share

You can also do this on the BitBucket website.

On the project page ( https://bitbucket.org/username/yourproject ) go to settings, repository data, and then change the name and save it.

+6
Aug 26 '14 at 17:24
source share



All Articles