Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to rename a repository on github? [duplicate]

Tags:

github

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).

like image 684
kaiser Avatar asked Apr 16 '11 12:04

kaiser


People also ask

How do I rename a cloned repository?

The fastest way to change the folder name when cloning a GitHub repository is to simply specify the name you want at the end of the git clone command. Here's a short video showing the entire process: When you're done downloading the repo do cd your-app-name to enter your directory with all the Create React App files.

Can two GitHub repos have the same name?

Description. If multiple repositories with the same name are opened it's impossible to distinguish between them in the drop-down menu opened via the "Current repository" button.


2 Answers

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 [email protected]:"yourname"/"projectname".git 

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

    git remote set-url origin [email protected]:"yourname"/"projectname".git 

Now it should be good to go.

like image 157
carolineggordon Avatar answered Sep 21 '22 06:09

carolineggordon


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.

like image 26
Russell Troywest Avatar answered Sep 24 '22 06:09

Russell Troywest