Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.2k views
in Technique[技术] by (71.8m points)

git - Is it possible to fork a github repo that I already own and then save it as a new repository?

Another simple question on how to handle in github following up on this: should I do a git fork then branch or just a git branch

I want to use an app that I have as a private repo as the starting point for a new app. It looks like I'd want to fork it and then clone it but when I fork it, I don't see a new repo. However, the fact that I can click fork makes me believe that this is possible? How would I achieve this or is there a better way for me to do this? I was thinking of just branching but I need to work with another developer and it would seem easier to just have these as separate repos.

thx

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can

  1. create a new private repository on github,
  2. then clone your current repository on github to your local machine,
  3. then add that new repository to one of the remote of the clone,
  4. and finally push it to the new repository.

For example, let say your current repository is git@github.com:me/current.git and the new one is git@github.com:me/new.git.

$ git clone git@github.com:me/current.git local-copy
$ cd local-copy
$ git remote add new-repo git@github.com:me/new.git
$ git push new-repo master

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...