Should I fork and clone my repository, or just clone the original?

If you don't intend to make changes to code, clone but don't fork. Forking is intended to host the commits you make to code, while cloning is perfectly fine for copying the content and history of the project.

If you later change your mind and want to publish commits you made to the cloned repository, you can always fork and push your commits from your original clone to the forked repo, it's just a matter of adding your fork's URL to the repo's remotes.


It doesn't really matter.

If you think you won't make any changes, you can safely clone the original repository directly, which has the benefit that you can directly update your local clone via git pull. Once you realize you want to make changes you can fork it on github and add the fork as an additional remote.

On the other side if you think you will make changes to the remote you can fork it. Once you realize that you were wrong and you don't need to make changes, add the original repository as remote and remove the fork.

I for myself prefer to always add both the fork and the original one as remote, thus I can update my local clone via (e.g.) git pull original master and after that I can update my fork with git push origin (origin is my private fork here. The names doesn't really matter either). If I don't need the fork or don't need it anymore, I get rid of it. If I need it (again), I (re-?)create it.

As a sidenote: You don't need a fork on github to make changes, because your local clone is a full repository too and if it's sufficient to keep your changes there, it's ok.

Tags:

Git

Github