0
0
Gitdevops~5 mins

Feature branch workflow in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a feature branch in Git?
A feature branch is a separate branch created from the main branch to develop a new feature independently without affecting the main code.
Click to reveal answer
beginner
Why use a feature branch workflow?
It helps keep the main branch stable by isolating new features until they are fully tested and ready to merge.
Click to reveal answer
beginner
What is the typical first step to start working on a feature branch?
Create a new branch from the main branch using: git checkout -b feature-branch-name
Click to reveal answer
beginner
How do you merge a feature branch back into the main branch?
First switch to the main branch with git checkout main, then merge using git merge feature-branch-name.
Click to reveal answer
intermediate
What should you do before merging your feature branch?
Make sure your feature branch is up to date with the main branch and all tests pass to avoid conflicts and errors.
Click to reveal answer
What command creates a new feature branch and switches to it?
Agit checkout -b feature-branch
Bgit branch feature-branch
Cgit merge feature-branch
Dgit commit -m 'feature branch'
Why should you keep feature branches separate from the main branch?
ATo speed up the internet connection
BTo delete the main branch
CTo avoid breaking the main code while developing new features
DTo make the repository smaller
What is the correct order to merge a feature branch back into main?
ADelete feature branch, then merge main
BMerge feature branch, then switch to main branch
CCommit changes, then delete main branch
DSwitch to main branch, then merge feature branch
What should you do if your feature branch is behind the main branch?
AUpdate your feature branch by merging or rebasing main into it
BDelete your feature branch
CIgnore the main branch changes
DPush your feature branch without updating
Which of these is NOT a benefit of using feature branch workflow?
AIsolates new features for safer development
BAutomatically fixes all bugs in the code
CAllows multiple developers to work independently
DKeeps main branch stable
Explain the steps to create, work on, and merge a feature branch in Git.
Think about the commands and order you use in Git.
You got /6 concepts.
    Why is the feature branch workflow important for team projects?
    Consider how teams avoid conflicts and bugs.
    You got /4 concepts.