How can I push two branches of the same project to different repos on github?
I have two branches locally:
On master I have a "coming soon" page that deploys to Github pages and in the meanwhile I work on develop locally.
But now I want to have a preview of "develop" on a different GitHub page, so i thought the best way of doing so would be to push only that branch to a different repo. Is that possible?
Thanks,
Matteo
You can push and fetch anything you want anywhere you've got the access. Just do it: add a remote for the other repo, call it "preview" or something, and git push preview develop
. If you also want that history in the original, push it there too.
I don't think you can push one branch to separate repo. You can do either of these things.
Or You can push master to Repo1, then change remote of your project using
git remote set-url origin new_url
then push your develop, But this will also push your master - You will have to separately remove that
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.