Chapter 8: Robots and remote clones

Remote and local branches

face Josiah Wang

If you try to view my commit history on your local copy, you may notice that my repo has an additional branch called origin/main.

user@MACHINE:~/josiah-robot$ git log --oneline  -5 
75d1feb (HEAD -> main, origin/main, origin/HEAD) Refactored robot to group its attributes like id, name, position and direction as a single dict representation. Refactored all relevant function implementations accordingly.
00dbd2d Abstracted rows and columns to be a single tuple representation.
1aecbb6 The program now generates a unique ID for each robot.
a12bc76 The program now generates multiple robots, each navigating to a different target cell.
f8a6583 Updated main.py to randomly pick a name for the robot from a pre-defined list. Also added robot_names.txt that contains the list of condidate names for the robot
user@MACHINE:~/josiah-robot$

origin is short for original, which says that this is my original (remote) version of a branch. So origin/main is the main branch on my remote repo, and the main branch you see is your local version. Any local changes you make will only affect your local copy of the main branch, until you try to synchronise with my remote origin/main branch.

Remote vs local branches

origin is really a default convention (like main and master). You can technically name it whatever you like.