Git: How to push a branch to a different remote

Hi, experts,

I have an open source project, and I want to have my closed branch within this project. I can push it to a different remote, for example, I can have my open source branches on github, and my closed branches on bitbucket. Would that work? Is there a better way, perhaps with forking?

Thank you,

PS. Both projects are mine, I just don't want to open source some part of it.
Who is Participating?
johanntagleConnect With a Mentor Commented:
Both can work.  For the additional repo, the following should do:

git remote add -t branch_name name_for_other_repo other_repo_url
kerznerAuthor Commented:
Well, you can do this with forks, and perhaps that is what I should do.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.