Lesson 6
Dealing with Sequences of Objects
Chapter 6: An army of robots
Git branch recap
We have covered quite a lot on Git in the previous lesson, so we will do just a small Git activity in this lesson.
Let us first recap git branch
from the previous lesson.
Recall that a git branch is a named pointer to your latest commit.
A git repo can have multiple branches. Each branch has a name, and points to the ‘tip’ (last commit) of that branch.
You can switch between branches at any time. The HEAD pointer tells you which branch you are currently working on.
Also recall that git checkout
will move the HEAD
pointer to the branch you specify, and also update the files in your working directory to show the latest commit in this branch. Sort of like checking out your grocery shopping from your shopping basket/trolley into your shopping bag at the checkout counter.
user@MACHINE:~/robot$ git checkout refactor
Switched to branch 'refactor'
user@MACHINE:~/robot$ git branch
main
* refactor