Github does not allow a forked repository to be private. This article describes a way to make a private repo that can pull new features of a public repo. The private repo will behave just as a forked repo of the public repo.

Bare Clone and Mirror Push

Duplicate public to private repository

  1. Create empty private repo
  2. Bare clone a public repo, and mirror push it to the private repo.
    $ git clone --bare
    $ cd public_repo.git
    $ git push --mirror
    $ cd ..
    $ rm -rf public-repo.git

Register remote repository with public repository

$ git clone
$ cd private_repo
$ git remote add public

Fetching from public repo

$ git pull public master 
$ git push origin master


  1. 0xjac/

Leave a comment