Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
General Development Skills  ›  Lesson

GitHub, GitLab and Bitbucket — Sharing the Repository

GitHub, GitLab, BitBucket 12 minHosting platforms keep a shared remote copy of a Git repository and add pull requests, reviews and automated checks around it.

GitHub, GitLab and Bitbucket — Sharing the Repository

Git on your laptop keeps your history. But ReadingRoom has three developers and a server that deploys it. Everyone needs one shared copy to push to, and a place to look at each other's changes before they land. That is what a hosting platform gives you.

The rule

Push branches, not main; merge through a reviewed, tested pull request.

GitHub, GitLab and Bitbucket all host Git repositories. The copy they hold is a remote, conventionally named origin.

git clone https://github.com/example/readingroom.git   # copy the remote down
git push -u origin add-loans                           # send your branch up
git pull                                               # fetch and merge others' work

On top of plain Git, each platform adds the same core ideas, with slightly different names:

Idea GitHub GitLab Bitbucket
Propose a merge Pull request Merge request Pull request
Automated checks GitHub Actions GitLab CI/CD Bitbucket Pipelines
Track work Issues Issues Jira integration

A pull request says: "here is my branch; please merge it into main." Teammates comment on the diff, and CI builds the code and runs dotnet test on it automatically. Branch protection can require passing checks and an approval before anything reaches main.

The shortcut

Think of three copies: your laptop, the remote, and main on the remote. Your work travels laptop → remote branch → (pull request) → main. It never jumps straight to main.

Shipping the loans endpointStep 1 of 4
  1. Push the branch

    git push -u origin add-loans puts your branch on the remote. Main is untouched.

The trap: treating the platforms as different tools to learn from scratch. The Git underneath is identical; only the buttons and names change.

Drills

Answer fast — trust the rule.

quick drill

What does GitLab call a pull request?

quick drill

What is origin in git push origin add-loans?

quick drill

Which feature stops untested code from reaching main?

quick drill

You switch from GitHub to Bitbucket. What changes about your daily Git commands?

Remember

  • Push branches, not main; merge through a reviewed, tested pull request.
  • Laptop → remote branch → pull request → main.
  • Same Git everywhere; GitLab says merge request.

Practice — level up

0/1 solved

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

ExplainWhy not push to main?

A new ReadingRoom contributor asks why they cannot just push straight to main on GitHub. Explain the pull request workflow, what the remote is, and what automated checks add.