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)
Which command can you use to check if
main
is the active branch?
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!
git switch
git switch
is not a valid command.
(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!
Hint.
Refer back to the section in the previous chapter, SectionΒ 3.3Β Switching Branches, on switching branches.
(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.