1.
To pull the changes from the upstream
main
branch into your local repo you first need to ensure that main
is the active branch in your local repo.(a)
git log
- The
git log
command gives information about the commits that have been made to the active branch. git branch main
- The
git branch main
command will try to create a new branch with the namemain
. git status
- Correct! The
git status
command can be used to check which branch is active. git switch main
- The
git switch main
command will makemain
main the active branch, not check which branch is active.
Which command can you use to check if
main
is the active branch?Hint.
Refer to Subsection 3.1.4.
(b)
git log
- The
git log
command gives information about the commits that have been made to the active branch. git branch main
- The
git branch main
command will try to create a new branch with the namemain
. git status
- The
git status
command will give you information about the active branch, it does not switch branches. git switch main
- Correct! The
git switch main
command will makemain
the active branch.
Hint.
Refer back to the section in the previous chapter on switching branches Section 3.3
(c)
Use the commands you have identified in the previous tasks to ensure that
main
is the active branch. Do not go on until your main
branch is the active branch.