Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Version Control and Hosting  ›  Capstone Project

Pull Requests on GitHub, GitLab and Bitbucket

GitLab 12 minHosting platforms turn a pushed branch into a pull or merge request where automated checks and reviewers approve the change before it is merged into main.

Pull Requests on GitHub, GitLab and Bitbucket

A teammate pushes a one-line change straight to main on a Friday afternoon, and notes-api goes down. Nobody reviewed it and no tests ran. Every hosting platform offers the same cure: changes arrive as proposals that are checked before they are merged.

The rule

Never push straight to main; propose a branch and let checks and people review it.

A pull request (GitHub and Bitbucket) or merge request (GitLab) is the same idea under two names: "please merge my branch into main". It shows the diff, collects review comments, and runs automated checks such as tests and linting. Branch protection rules can then require passing checks and at least one approval before the merge button works, and block direct pushes to main.

The three big hosts differ mostly in what surrounds the repo:

Platform Known for
GitHub The largest open-source community; GitHub Actions for automation
GitLab CI/CD built into the product; can be self-hosted on your own servers
Bitbucket Part of Atlassian's tools, with close Jira integration; Bitbucket Pipelines for CI

Git itself is identical on all three, so your commands never change. Only the web workflow and the pipeline configuration file differ.

A small, focused pull request gets a better review than a huge one. A useful description says what changed, why, and how it was tested.

The shortcut

Remember the loop as six beats: branch, push, open, check, review, merge. Then delete the branch. Whatever the platform, the same loop applies.

Changing the notes-api timeout the reviewed wayStep 1 of 5
  1. Branch and push

    git switch -c fix/timeout, commit, git push -u origin fix/timeout.

The trap: treating review as a rubber stamp. The reviewer's job is to understand the change, and the author's job is to make that easy by keeping it small.

Drills

Answer fast — trust the rule.

quick drill

What does GitLab call a pull request?

quick drill

Which setting stops people pushing directly to main and requires approval first?

quick drill

During review you push a new commit to the same branch. What happens to the open pull request?

quick drill

Which platform is best known for built-in CI/CD and the option to self-host?

Remember

  • Never push straight to main; propose a branch and let checks and people review it.
  • Shortcut: branch, push, open, check, review, merge, then delete the branch.
  • Trap: huge pull requests and rubber-stamp reviews.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainThe reviewed change

Explain how a one-line change to notes-api should travel from your laptop to main on a team that uses GitHub, GitLab or Bitbucket, and why this is safer than pushing straight to main.