GitHub Teamwork

Repository setup, branching, pull requests, reviews, and issues

One Repository, Many Contributors

This session turns version control into a team workflow. The goal is not only to push code, but to make changes traceable, reviewable, and easy to merge.

Set Up the Shared Repository

Host the repo

Create the repository, fill in the basics, and decide who owns the remote.

Add collaborators

Invite teammates first. Review only works if the right people can see and comment on the code.

Clone locally

Work in VS Code or the terminal from a local clone, not by editing files in the browser.

First shared commit

Create a simple README or starter file once, then push it so everyone starts from the same baseline.

Branch-Based Workflow

git clone <repo-url>
git checkout -b feature/short-task-name
git add .
git commit -m "Implement the first draft"
git push -u origin feature/short-task-name

Do not work directly on main. Each branch should map to one small task so the review is focused and conflicts stay manageable.

Pull Request Anatomy

Base and compare

The base branch should be main. The compare branch should be the feature branch you just pushed.

Title and description

The title states the change. The description explains the intent, what changed, and what needs review.

Assignee and reviewer

Assign the person doing the work and the person who will review it.

Work in progress

Use [WIP] in the title when the branch is not ready for review yet.

Review and Merge

Files changed

Review only the diff against main, not the whole repository.

Line comments

Comment directly on the lines that need clarification or revision.

Review outcome

Choose comment, approve, or request changes based on the actual state of the branch.

Merge only when ready

Once comments are resolved and the team agrees, merge and stop working on that branch.

Issues Keep the Team Organized

Issue

Describe one task or bug clearly and assign it to one person.

Branch

Create a dedicated branch to address that issue only.

Pull request

Open a PR from that branch and mention the issue number in the description.

Merge and close

After the PR is merged, the issue becomes the record of why the change happened.

Team Working Agreement

Do
  • keep PRs small,
  • write descriptive branch names,
  • review before merging,
  • update main locally after a merge.
Avoid
  • committing directly to main,
  • asking for review on unfinished work,
  • mixing unrelated tasks in one branch,
  • ignoring review comments.