The Pull-Request Workflow

How Teams Actually Work

Professional teams rarely commit straight to main. The standard flow:

  1. Branch off main: git switch -c feature-x
  2. Commit your work in small, logical steps
  3. Push the branch: git push -u origin feature-x
  4. Open a Pull Request (PR) on GitHub - a request to merge your branch
  5. Teammates review, CI runs tests, you address feedback
  6. Merge the PR; delete the branch
Goal: Understand why main is protected: it's the branch that ships to production. PRs are the quality gate - review + automated tests - before anything reaches it.
Tip: Keep PRs small and focused. A 40-line PR gets reviewed in minutes; a 2,000-line PR sits for days and hides bugs. Small branches = fast, safe delivery.
Note: A fork is your own server-side copy of someone else's repo - the model for contributing to open source when you don't have write access. You fork, branch, PR back to the original.