Stage 7 - Collaboration with Pull Requests

task-service now exists on GitHub. The team now expects review before merge. This is where pull requests become the practical control point between local git work and stable main.

Git pull request workflow

Pull request = proposed merge with context

A PR is not only a request button. It is a review workspace containing:

  • commit list,
  • changed files,
  • comments,
  • checks status,
  • history of updates.

In other words, PR is where your branch changes are negotiated before integration.

Branch workflow on task-service

From remote main, create a feature branch, apply a clear change, and push it:

git switch main
git pull
git switch -c feature/task-export

Apply one focused change. Create task-service-export.json in your editor with this content:

{"version":"1.0","export":"json"}

Then commit and push it:

git add task-service-export.json
git commit -m "feat: add export format contract file"
git push -u origin feature/task-export

Create PR in GitHub UI from feature/task-export to main.

Fork workflow vs same-repo workflow

In an internal repo, you usually create branches in the same repository.

In OSS, you might not have write access. Then you:

  1. fork upstream,
  2. clone your fork,
  3. push branch there,
  4. open PR to original repository.

Both approaches carry the same principle: branch is first local, then remote, then reviewed merge.

Working with review comments

Review comments are part of engineering communication, not criticism.

git switch feature/task-export
# fix comment-required change
git add task-service-export.json
git commit -m "fix: include metadata in export contract"
git push

GitHub automatically updates PR while comments are addressed on the same branch.

Term Role in this stage
Fork Your own remote copy when direct push is restricted
PR Shared review room before merge
Review comment Concrete technical feedback tied to location
Push after review New commit that amends same PR content

When review passes, the merge is often the smallest risk because work arrived as a tested, discussed, and intentional branch.

Review as engineering practice, not bureaucracy

A strong PR is not about more text, it is about reducing future ambiguity. Include three anchors in each PR body:

  • what behavior changed,
  • what was not changed,
  • how to validate quickly.

If your PR has only a broad statement and no validation steps, reviewers spend extra time reconstructing context. In this course scenario, always add a short test command, an example input, or a manual check for task-service.

You can also treat review comments as a product design feedback loop. Instead of arguing over preference, ask: does this change reduce risk for the next developer who will read this commit chain?

Glossary
version control
A system for tracking project changes over time so developers can inspect, compare, and restore previous states.
repository
A storage area for a project, its files, history, and related metadata.
commit
A saved Git history point that records a related set of changes, the author, and the reason for the change.
branch
An independent line of work where changes can be developed without immediately affecting another line.
merge
The operation that combines changes from one branch or source into another.
conflict
A situation where a tool cannot automatically combine changes because different edits affect the same part.
staging area
The Git area where selected changes are prepared before they become part of the next commit.
working tree
The current files and folders checked out in your project directory, including uncommitted edits.
diff
A comparison that shows exactly which lines or values were added, removed, or changed.
remote
A named connection to a repository stored somewhere else, usually on a server such as GitHub.
clone
The operation that copies an existing repository from a remote location to your local machine.
push
The operation that sends local commits or changes to a remote repository.
pull
The operation that downloads changes from a remote repository and integrates them locally.
pull request
A review request that proposes merging one branch into another and gives teammates a place to discuss changes.
fork
A personal copy of another repository, usually used to propose changes without direct write access.
review
The engineering practice of checking changes for correctness, clarity, risks, and maintainability.
rollback
A deliberate return to an earlier safe state after a mistake, regression, or unwanted change.
rebase
A Git operation that moves commits to a new base commit, often used to make history more linear.
tag
A named marker pointing to a specific version, commit, image, or release artifact.