Skip to content
Related Articles
Open in App
Not now

Related Articles

Git – Fork

Improve Article
Save Article
Like Article
  • Last Updated : 05 Apr, 2022
Improve Article
Save Article
Like Article

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:

  1. You have your own copy of the project on which you may test your own changes without changing the original project.
  2. 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.
  3. 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:

 

Procedure:

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.

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!