Categories
tech

Maintaining forked private repo of a public repo

Lets assume you working on a public github repo e.g., https://github.com/parag/simplenlg-python3 . You have done git clone this repo but now you want to extend this library but privately. You could maintain a new branch ‘dev’ locally or since you are not pushing to master, you can maintain just master branch only. Advice to maintain a different branch though. You could push this ‘dev’ branch to master of your repo.

If you are wondering what is the use case, this is majorly used if your production systems are dependent on the repo and original author is not very active to accept your changes which you want to push to your server.

Imaging you have created a private new repository over bitbucket.

First, checkout a new branch:
git checkout -b dev

Add a new remote in your current local:
git remote add private git@bitbucket.org:paragarora/sp3.git

Now push this branch to master of new private repo
git push -u private dev:master

You could also push public master branch to your private branch
git push -u private master:github_master

Leave a Reply

Your email address will not be published. Required fields are marked *