how to rename a repository on github?

Github

Github Problem Overview


> Possible Duplicate:
> Change repo name in github

I got some github repos that i now need to rename, but i can't anywhere find a solution for this except deleting the repo and setting up a new one. I can't delete the repos, because there are a lot of links pointing to the current repos, which i don't want to loose. Anyone any idea on how to do this? (I already read a lot of the google results and searched the github support).

Github Solutions


Solution 1 - Github

I have changed the name of repositories before, and I'm doing it again right now ;-)

Edit the name using the built-in feature under the "Settings" tab at the top of your GitHub repository page. Then go to your local repository and rename the remote. Like this:

  1. First remove it:

     git remote rm origin
    
  2. then add back the new name

     git remote add origin git@github.com:"yourname"/"projectname".git
    

If you have recent enough git version you should use set-url command:

    git remote set-url origin git@github.com:"yourname"/"projectname".git

Now it should be good to go.

Solution 2 - Github

Yes you can, see here:

Rename github repo

If I understand you correctly you want to rename your git repository eg xyz.git to xyz1.git and then have all the git repositories that link to that repo link to the new name automatically?

As far as I know this isn't possible. Each repository is self contained and keeps a list of locations it links to. If one of those locations changes its name the link would be broken. Each repository that references the changed name would need to update its link.

But then, the same would happen if you deleted a repository and recreated it under a new name....

Just realised you were specifically talking about GitHub and not git in general, sorry - should learn to read the entire question like my school teachers said. The answer still stands, with the addition that you can change the name in GitHub from the Admin page.

Solution 3 - Github

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkaiserView Question on Stackoverflow
Solution 1 - GithubcarolineggordonView Answer on Stackoverflow
Solution 2 - GithubRussell TroywestView Answer on Stackoverflow
Solution 3 - GithubbraitschView Answer on Stackoverflow