Fork a repo
A full copy of another repo on GitHub under your GitHub account.
- Same commit at the time of forked.
- Still linked to the original repo (upstream).
- When don’t have write access to the original repo (not the collaborator)
- But enables opening Pull Requests (PRs)
- Not same as clone, happened in Github, by
- Created using Fork button
- Will redirect to your forked repo
Why create branches in a fork?
- One branch = one task (bug / feature)
- Keep main clean
- Allow multiple PRs at the same time
- Easy to modify or abandon changes
- Easier review for maintainers
Steps from fork to pr:
- Create fork
- Clone the forked repo
- git remote add upstream
- Create branch in fork repo