Recall & Review
beginner
What is a Git branch?
A Git branch is like a separate workspace where you can make changes without affecting the main project. It helps you work on different features or fixes at the same time.
Click to reveal answer
beginner
How do you create a new branch in Git?
Use the command
git branch <branch-name> to create a new branch.Click to reveal answer
beginner
How can you switch between branches in Git?
Use
git checkout <branch-name> or git switch <branch-name> to move between branches.Click to reveal answer
beginner
What does it mean to work in multiple branches simultaneously?
It means you have different branches for different tasks or features, and you switch between them to work on each separately without mixing changes.
Click to reveal answer
beginner
How do you see all branches in your Git repository?
Use
git branch to list all branches. The current branch will have a star (*) next to it.Click to reveal answer
Which command creates a new branch called 'feature'?
✗ Incorrect
The correct command to create a new branch is
git branch feature.How do you switch to an existing branch named 'bugfix'?
✗ Incorrect
Use
git checkout bugfix or git switch bugfix to switch branches.What does the star (*) mean when you run
git branch?✗ Incorrect
The star (*) shows which branch is currently checked out.
Why work in multiple branches simultaneously?
✗ Incorrect
Branches let you work on different tasks without mixing changes.
Which command lists all branches in your repository?
✗ Incorrect
git branch lists all branches and marks the current one.Explain how you can work on two different features at the same time using Git branches.
Think about having separate workspaces for each feature.
You got /3 concepts.
Describe the steps to create a new branch, switch to it, and check which branch you are currently on.
Remember the commands: git branch, git checkout, git switch.
You got /3 concepts.