Let's say you have a framework on GitHub and want to use it to create other sites, so you want to:
- clone it locally
- change it
- push it to a new repository
These are the instructions I currently have for this:
git clone https://github.com/yourname/framework.git newsite
cd newsite
- (make changes)
- on Github, create new repository called "newsite"
git remote add origin2 https://github.com/yourname/newsite.git
git push -u origin2 master
I unfortunately have to push to origin2
otherwise it pushes back to my original framework, which I don't want, of course.
But this causes the problem that I may inadvertently push to origin at some time in the future.
How can I make my new repository origin?
Or is there a more straight-forward way to do this when you want to (1) clone a repository, but (2) push it to a different repository?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…