Forking creates your own personal copy of someone else's repository on GitHub, which you can freely change without affecting the original project.


Fork, then clone

Click 'Fork' on GitHub to copy a repository into your own account, then clone your fork to your machine so you can make changes locally.

Keeping your fork updated

The original project keeps moving after you fork it. Adding it as a second remote, often called 'upstream,' lets you pull in the latest changes whenever needed.

Contributing back

After committing your changes and pushing them to your fork, open a pull request from your fork back to the original repository to propose your contribution.

>_ COMMANDS YOU'LL USE
git clone https://github.com/yourname/repo.gitClone your forked copy of the repository
git remote add upstream https://github.com/original/repo.gitTrack the original repository as a second remote
git fetch upstreamDownload the latest changes from the original project
git merge upstream/mainBring the original project's updates into your fork
💡Forking is the standard way to contribute to open-source projects where you don't have direct write access.
⚠️Common mistake: Not syncing a fork with upstream