Building Apps with AILesson 40 of 87

Module 5 · Save points, and shipping to a stranger

Branches for the risky change

In this lesson

  • 8 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 4 of 11 in this chapter

This chapter’s goalKeep a project in git well enough to undo any hour (stage part of a change, restore one file, revert a pushed commit, recover from a bad reset, branch for an agent’s work and merge it back) and put the app on a free host with a real domain, environment variables scoped per environment, and a version stamp that says which commit is live.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 8Free · no account needed
Lesson steps

A branch is a sticky note

Inside your project, .git/refs/heads/main is a file containing forty-one bytes: the id of a commit and a newline. That is a branch. It is a name that points at a commit, and when you commit on that branch the name moves forward to the new one.

main is not special. It is the default name and nothing more. Creating a branch writes another forty-one-byte file, which is why it is instant and free, and why the advice in this lesson is to use them more often than you would guess.

Bash
git switch -c payments      # create and move to it (older form: git checkout -b)
git branch                  # list branches; the * marks where you are
git switch main             # go back

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Building with AI exam.

Stuck on something?Ask Beatriz, your AI tutor

How to cite: Addaly (2026) ‘Branches for the risky change’, in Building Apps with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/building-apps-with-ai/branches-for-the-risky-change (Accessed: 29 November 2026).