This is basically an article for Git/Github NEWBIES
Let’s start by explaining each one at a time :
CLONING :
is simply the process of downloading a GitHub project from an online repository to your local machine using Git.
Once it’s on your local machine, you can make edits to your local copy and PUSH your code or PULL changes made to the online repository into your local copy of the project using Git.
FORKING:
When you fork a repository, you create a copy of the original repository (upstream repository) but the repository is copied to your GitHub account, not on your local machine.
Forking a project is as easy as clicking the Fork button in the header of a repository.
Forking is a concept while cloning is a process. Forking is just containing a separate copy of the repository and there is no command involved. Cloning is done through the command ‘git clone‘ and it is a process of receiving all the code files to the local machine.
NOW LET’S SEE HOW FORK AND CLONE ARE USED TOGETHER:
Let’s say you want to contribute to an open-source project;
First, you Fork the project’s GitHub repository, now that you have it on your Github account, You Clone it using the commit “git clone”, now It’s on your local machine.
Now you can apply any changes or edits you which to on the local copy on your machine, once you finished your edits you commit them and push them to your Github repo.
Your Github repo now is synced with the changes made to your local machine’s copy, it’s time to merge those changes with the original “open-source project repo”.
Changes made to the forked repository can be merged with the original repository via pull request. A Pull request knocks on the repository owner and tells them “Please check my changes and merge them if you like it”
If they accept, the original repo will have your changes in it, and Congrats you just contributed to an Open-source project
Connect with me on Linkedin for more interesting tech stuff!
Thank you very much for your attention