My github repo is called Programming-iOS-4-Book-Examples, because it's the example code from my book "Programming iOS 4". Now I've written a new edition of the book, retitled "Programming iOS 5". I need to leave the old repo in place with the old name, because there are links to it all over the net and someone might need the old code. But now I also want a new repo with a new name, Programming-iOS-5-Book-Examples, containing the same examples rewritten for iOS 5 (plus some new ones).
Naturally, I saw this: How can I fork my own GitHub repository? But the advice there is to use branches. That isn't going to work for me. I don't want to use a branch because that defeats the purpose of giving the repo a name that I can link to. I want the public to find my iOS 4 examples in the iOS 4 repo and my iOS 5 examples in the iOS 5 repo.
This seems like a perfect use of a fork, but when I press the Fork button nothing happens; I'm apparently not allowed to fork my own repo.
Of course I could just make this a whole new repo, but that would mean uploading all the resources separately, which is unfortunate because everything is already right there in the iOS 4 repo. Do I just have to do that anyway?
Forking someone's repository on GitHub is very easy. You just click the Fork button on their repository page, and you will get your own personal copy of their repository in your GitHub account, simply clone it and you're good to go.
Most commonly, forks are used to either propose changes to someone else's project to which you do not have write access, or to use someone else's project as a starting point for your own idea. You can fork a repository to create a copy of the repository and make changes without affecting the upstream repository.
It is a better option to fork before clone if the user is not declared as a contributor and it is a third-party repository (not of the organization). Forking is a concept while cloning is a process. Forking is just containing a separate copy of the repository and there is no command involved.
Just go to https://github.com/new/import . In the section "Your old repository's clone URL" paste the repo URL you want and in "Privacy" select Private .
You can't have two repositories with the same name, and forking on Github automatically transfers the name, so that's what keeps that from working. It sounds like you would be well served by adding a branch locally, then pushing to a new Github repository with the new name. You can even keep the Github repo showing master
as the branch:
git clone git://github.com/you/repo.git git checkout -b new_book [ create new repo on Github ] git remote add new_origin git://github.com/you/repo.git git push new_origin new_book:master
Just use more appropriate names and you're golden. You can merge updates to shared examples, add additional examples to the new book code, and you just push to both origin
and new_origin
(using the example names above) when you make changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With