Christopher Dorian
Christopher Dorian

Reputation: 2243

Git master branch in one repository and another branch on another private repository

Is it possible to use a public repository like github and have a branch exist on a private repository?

I want my master branch to be public, but I also want to work from a private branch (perhaps on another host) which I can work from. Occasionally, I would like to pull updates from the master branch as it's updated.

Am I better off just using 'git clone'?

Upvotes: 0

Views: 132

Answers (2)

mrutyunjay
mrutyunjay

Reputation: 8290

Yes you can use git push for that

$git push origin local_branch_name:remote_branch_name

Upvotes: 0

Benjamin Bannier
Benjamin Bannier

Reputation: 58566

Of course you can decide which branch to push to a remote repository. Assuming your github repository is called origin you would push only master with

$ git push origin master

Upvotes: 1

Related Questions