The [repository](https://github.com/raman-babich/public-private-fork-poc) for the assignment is public and Github does not allow the creation of private forks for public repositories. The correct way of creating a private frok by duplicating the repo is documented [here](https://help.github.com/articles/duplicating-a-repository/). For this assignment the commands are: 1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.) ```bash git clone --bare git@github.com:raman-babich/public-private-fork-poc.git ``` 2. [Create a new private repository on Github](https://help.github.com/articles/creating-a-new-repository/) and name it `private-private-fork-poc`. > If you are unable to create a private repo, you can request unlimited private repos as a student by getting > the [student pack](https://education.github.com/pack) from Github. 3. Mirror-push your bare clone to your new `private-private-fork-poc` repository. > Replace `` with your actual Github username in the url below. ```bash cd public-private-fork-poc.git git push --mirror git@github.com:/private-private-fork-poc.git ``` 4. Remove the temporary local repository you created in step 1. ```bash cd .. rm -rf public-private-fork-poc.git ``` 5. You can now clone your `private-private-fork-poc` repository on your machine (in my case in the `code` folder). ```bash cd ~/code git clone git@github.com:/private-private-fork-poc.git ``` 6. Add the original repo as remote. ```bash git remote add upstream git@github.com:raman-babich/public-private-fork-poc.git ``` You can list all your remotes with `git remote -v`. You should see: ``` origin git@github.com:/private-private-fork-poc.git (fetch) origin git@github.com:/private-private-fork-poc.git (push) upstream git@github.com:raman-babich/public-private-fork-poc.git (fetch) upstream git@github.com:raman-babich/public-private-fork-poc.git (push) ``` Update remotes: ```bash git remote update ``` Create `upstream-master` branch and configure upstream to `upstream/master`. Configure upstreams for branches: ```bash git checkout -b upstream-master upstream/master ``` `upstream-master` will be your local convenient clone of the `git@github.com:raman-babich/public-private-fork-poc.git` `master` branch. You can simple `git pull` and `git push` to pull or push from `git@github.com:raman-babich/public-private-fork-poc.git` `master` branch. 7. If you have new commits on your public repo and you want to sync up them with private one. ```bash git checkout upstream-master git pull git checkout master git merge upstream-master ``` Or ```bash git checkout master git pull upstream master ``` And resolve conflicts if they appear. 8. If move some commits from your private fork to public repo. (Just cherry pick them) ```bash git checkout upstream-master git pull git cherry-pick git push ``` Resolve conflicts if they appear.