Having a private branch of a public repo on GitHub?

前端 未结 4 1736
太阳男子
太阳男子 2020-11-30 17:25

I have a public PHP project in a GitHub repo, which contains just one branch (master).

I want to have a separate branch/fork that is private for me (I have paid for

4条回答
  •  执笔经年
    2020-11-30 17:50

    1. Duplicate your repo.
    2. Make the duplicated repo a private one on GitHub.
    3. Clone the private repo to your machine
    4. Add a remote to your public repo (git remote add public git@github.com:...)
    5. Push branches with commits intended for your public repo to that new public remote. (make sure you don't accidentally commit private-only code)
    6. You can bring in changes to your public repo using 'git fetch public' and then merge them locally and push to your private repo (origin remote).

提交回复
热议问题