What is a fork?
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
How to fork?
It's so simple that it happens on a click of a button.
The fork button will be available on the top right corner of any Github repository.
Now you can clone the forked project to your machine locally.
You can clone using SSH or HTTPS.
git clone git@github.com:sudharsangs/styled-components.git
Now that you have cloned the repository. You have to make sure you are syncing with the original one. Syncing means if the maintainer of the repository updates the code you should be able to get that in your forked repository.
cd styled-components
git remote add upstream https://github.com/styled-components/styled-components.git
Now you have set the upstream of your cloned repository to the original one.
To get the updated code you should execute the following commands.
git fetch upstream
git merge master upstream/master
This is how you fork and contribute to any repositories on Github.
Happy Forking
Top comments (0)