Easiest way to rename git project configured on BitBucket

前端 未结 4 1760
孤独总比滥情好
孤独总比滥情好 2021-02-03 16:51

I have a project hosted on BitBucket

Can I rename it ?

If not and I need to create a new repository can someone tell me the easiest way to do that and have new r

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-03 17:31

    I think this is the easiest way:

    1. Rename your project from the bitbucket settings menu
    2. Clone your newly re-named project
      • git clone new_url

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

    If you prefer to keep using the existing local repo in my opinion it's easier to use git to update itself instead of manually editing a config file:

    1. Rename your project from the bitbucket settings menu
    2. Change directory into your local project and update git to fetch data from the newly renamed repo
      • git remote set-url origin new_url
    3. Optionally (git doesn't care) rename your local project directory
      • mv projectname newprojectname

提交回复
热议问题