Stage 2 · Lesson 4 of 8
Branches and merging
A is a movable label pointing at a commit. It lets you work on a feature without touching the main line of work. git switch -c add-export creates a branch and moves to it, git switch main goes back, and git branch lists them.
When the feature is done, switch to main and run git merge add-export. If main has not moved, just slides the label forward, which is called a . If both sides have new commits, it creates a that joins them.
Keep main working at all times, and make every change on a short-lived branch. That is exactly the habit rely on. Rebase is another way to combine work, and it can wait.
A question to check yourself, an AI practice session and 2 cheat sheet entries come when you add the roadmap to your account. Add it
Resources for this stage
Start with· follow one of these
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
MIT lectures on dev tools; the shell, shell tools and version control lectures are enough
- GitHub repoFreeGitHub Skills: Introduction to GitHub
GitHub · Beginner
Free one-hour exercise: branch, commit, open and merge a pull request