Skip to content
Learn Netverks

Lesson

Step 4/5 80% through track

branches

Branches and merges

Last reviewed May 28, 2026 Content v20260528
Track mode
none
Means
Read / quiz
Reading
~1 min
Level
beginner

This lesson

This lesson covers Branches and merges as part of the Git track.

Version control is required for every professional codebase—this track builds habits before framework magic.

Pull requests, CI pipelines, open-source contributions, and local feature branches.

Read the lesson, run the copy-paste commands in your terminal, then verify with the self-check and MCQs.

Before collaborating on team repos or applying to junior roles.

Branches let you experiment without breaking main. Feature branches are the default collaboration model.

Commands

git branch feature/login
git switch feature/login   # or: git checkout feature/login
# ... work, commit ...
git switch main
git merge feature/login

Merge conflicts

When two branches edit the same lines, Git marks conflicts in files. You edit to the correct result, git add, then complete the merge.

Self-check

  1. What is a branch pointer conceptually?
  2. When might you prefer rebase over merge? (high level)

Interview prep

What is a branch in Git?

A movable pointer to a commit. New commits advance the current branch; other branches can advance independently until you merge or rebase.

What happens in a merge conflict?

Two branches changed the same region of a file; Git inserts conflict markers. You edit to the correct combined content, then git add and complete the merge or rebase.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What part of this lesson needs a second read?
  • What would you try differently in a real project?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump