Challenge - 5 Problems
Feature Branch Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of creating and switching to a feature branch
What is the output of the following commands when run in a Git repository?
git branch feature-login
git checkout feature-loginGit
git branch feature-login git checkout feature-login
Attempts:
2 left
💡 Hint
The second command switches your working directory to the new branch.
✗ Incorrect
The first command creates a new branch named 'feature-login'. The second command switches to that branch, showing 'Switched to branch 'feature-login''.
🔀 Workflow
intermediate2:00remaining
Correct sequence to integrate a feature branch
Which option shows the correct sequence of commands to update your feature branch with the latest changes from the main branch before merging?
Attempts:
2 left
💡 Hint
You need to update main first, then merge main into your feature branch.
✗ Incorrect
First switch to main and pull the latest changes. Then switch to your feature branch and merge main into it to update your feature branch.
❓ Troubleshoot
advanced2:00remaining
Resolving a merge conflict in a feature branch
You tried to merge the main branch into your feature branch and got a conflict. What is the correct next step to resolve the conflict?
Git
git checkout feature git merge main
Attempts:
2 left
💡 Hint
Conflicts must be fixed manually before committing.
✗ Incorrect
When a merge conflict occurs, you must manually edit the files to resolve conflicts, stage the changes with 'git add', then commit to complete the merge.
✅ Best Practice
advanced2:00remaining
Best practice for naming feature branches
Which naming style is considered best practice for feature branches in Git?
Attempts:
2 left
💡 Hint
Use lowercase letters and hyphens for readability.
✗ Incorrect
Using lowercase letters with hyphens (kebab-case) is a common best practice for branch names because it improves readability and consistency.
🧠 Conceptual
expert2:00remaining
Why use feature branches in Git workflows?
What is the main advantage of using feature branches in a Git workflow?
Attempts:
2 left
💡 Hint
Think about how teams work on different features at the same time.
✗ Incorrect
Feature branches allow developers to work on new features separately from the main codebase, reducing risk and enabling parallel development.