0
0
Gitdevops~5 mins

Working in multiple branches simultaneously in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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'?
Agit branch feature
Bgit create feature
Cgit new branch feature
Dgit switch feature
How do you switch to an existing branch named 'bugfix'?
Agit branch bugfix
Bgit checkout bugfix
Cgit create bugfix
Dgit init bugfix
What does the star (*) mean when you run git branch?
AIt marks the current branch you are on
BIt shows a deleted branch
CIt indicates a remote branch
DIt means the branch has conflicts
Why work in multiple branches simultaneously?
ATo delete old code
BTo speed up the computer
CTo keep different tasks separate and avoid mixing changes
DTo merge all changes automatically
Which command lists all branches in your repository?
Agit status
Bgit list
Cgit show branches
Dgit branch
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.