Git – Fork
Forking a repository means creating a copy of the repo. When you fork a repo, you create your own copy of the repo on your Github account. This is done for the following reasons:
- You have your own copy of the project on which you may test your own changes without changing the original project.
- This helps the maintainer of the project to better check the changes you made to the project and has the power to either accept, reject or suggest something.
- When you clone an Open Source project, which isn’t yours, you don’t have the right to push code directly into the project.
For these reasons, you are always suggested to FORK. Let’s have a screenshot walkthrough of the whole process. When getting started with a contribution to Open Source Project, you have been advised to first FORK the repository(repo). But what is a fork?
You must have seen this icon on every repo in the top right corner. Now, this button is used to Fork the repo. But again, what is a fork or forking a repository in Github as shown in the below media as follows:
Step 1: Go to CPython’s official repository.
You can see python/cpython. This means python is the maintainer and cpython is the project’s name.
Step 2: Find the Fork button on the top right corner.
Step 3: Click on Fork.
You will see this screen.
Step 4: Now you have your own copy of the repository.
But how can we confirm for which do refer to below visual aid as follows:
Now we can see my user name(ayushmankumar7)/cpython and also below that, we have the link to the original project I forked from.
Whatever changes are made to ‘ayushmankumar7/cpython’ will now change the original python/cpython. We can make my changes here and then make a Pull Request to the maintainers of the project. Now it is in their hand if they will accept or reject your changes to the main project.
Please Login to comment...