DCubes
Git module

Lesson 7

Merge basics

Merge a feature branch into main with a fast-forward or merge commit.

beginner30 minRun on your machine

What you will be able to do

  • Merge a feature branch into main
  • Read log after merge
  • Delete a merged branch locally

Why this matters for data work

Merge is how finished work lands on the shared line of history. PRs on GitHub perform the same merge after review.

Concepts

  • git switch main then git merge feature/…
  • Fast-forward — main simply moves forward when possible
  • Merge commit — when histories diverged

Practice on your machine

cd ~/dcubes/git-lab/init-demo
git switch main
git merge feature/add-sql-note
git log --oneline --graph | head
ls notes.sql
git branch -d feature/add-sql-note
git branch

What you should see

  • notes.sql on main.
  • Feature branch deleted after -d.
  • Clean status.

Common mistakes

  • Merging the wrong direction — always merge into the branch you have checked out.
  • Force-deleting unmerged work with -D casually.

Next

Conflicts