How to Apply Fork in GitHub
Forking is creating a personal copy of another repository on GitHub so you can modify it without affecting the original project.
1. Go to the Repository
Open the repository you want to fork.
https://github.com/owner/repository-name
2. Click the Fork Button
At the top-right corner of the repository page, click the Fork button. GitHub will create a copy of the repository in your account.
github.com/your-username/repository-name
3. Clone the Forked Repository
git clone https://github.com/your-username/repository-name.git
cd repository-name
4. Add the Original Repository (Upstream)
git remote add upstream https://github.com/original-owner/repository-name.git
git remote -v
5. Create a New Branch
git checkout -b feature-update
6. Make Changes and Commit
git add .
git commit -m "Added new feature"
7. Push Changes to Your Fork
git push origin feature-update
8. Create a Pull Request
Go to your forked repository on GitHub and click Compare & Pull Request to submit your changes to the original repository.
Fork Workflow Summary
- Fork repository
- Clone fork locally
- Add upstream remote
- Create feature branch
- Make changes and commit
- Push branch
- Create pull request