I googled and also searched on stackoverflow for the below question, however was unable to find any satisfactory answer.
So say, I have a remote repository: https://github.com/<username>/foo
and I
wish to rename it to https://github.com/<username>/bar
at the remote site as well as in local config entries from command line, and right now I have the repo cloned locally at '~/my_github_repos/foo'.
So basically, I want all the things for this repo to be converted from foo
to bar
( urls / configurations / local folder )
For that, I renamed the folder ~/my_github_repos/foo/
to ~/my_github_repos/bar/
and tried doing,
git remote set-url origin https://github.com/<username>/bar.git
But that just did it locally and not remotely. So when I made some changes in the files inside the now renamed folder, bar
and did a git push origin master
, It gave me error:
remote: Repository not found.
fatal: repository 'https://github.com/<username>/bar.git/' not found
So, what all things do I need to do so that I make the changes locally and get it reflected remotely, for the renaming of repo ?
I know Github.com provides a very nice UI for renaming the repos, however I just want to know if there is a way to do so in few steps from command line. If not, I agree that it's simple to just rename it from github.com website.
The reason for this question is that, I like to do things mostly from commandline rather than go here and there for doing tasks as simple as renaming a repo.
P.S. I searched stackoverflow and found this: Rename Github Repository, which may seem similar to this question, but it's different.