Can/should I fork my own github repo?

前端 未结 4 1091
迷失自我
迷失自我 2021-01-31 10:21

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, retitle

4条回答
  •  逝去的感伤
    2021-01-31 10:58

    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.

提交回复
热议问题