Good Code
The good version fetches first, inspects upstream commits, rebases the feature branch intentionally, and runs tests after integration.
Lesson 05
Fetch before integrating upstream work, then choose merge or rebase intentionally for the branch you are on.
# Fetch makes upstream changes visible before integration.
git fetch origin
git log --oneline --decorate --max-count=5 HEAD..origin/main
git rebase origin/main
npm test# Pulling without inspecting upstream makes the integration implicit.
git pull
git push --force
git statusThe good version fetches first, inspects upstream commits, rebases the feature branch intentionally, and runs tests after integration.
The bad version lets pull decide the integration behavior and follows with a force push without checking what changed.