0
0
Gitdevops~20 mins

Required status checks in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Required Status Checks Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of enabling required status checks in GitHub?
You enable required status checks on a branch in GitHub. What happens when a pull request is opened without passing these checks?
AThe pull request is merged automatically regardless of status checks.
BThe pull request cannot be merged until all required status checks pass.
CThe pull request is closed automatically by GitHub.
DThe pull request is merged but marked as failed.
Attempts:
2 left
💡 Hint
Think about what 'required' means for status checks in a branch protection rule.
🧠 Conceptual
intermediate
1:30remaining
Which of these is NOT a benefit of required status checks?
Select the option that is NOT a benefit of using required status checks in a Git workflow.
AEnsures code passes tests before merging.
BPrevents broken code from entering main branches.
CAutomatically resolves merge conflicts.
DEnforces team quality standards.
Attempts:
2 left
💡 Hint
Think about what status checks do versus what merge conflict resolution means.
Configuration
advanced
2:00remaining
How to configure required status checks on a GitHub branch using CLI?
Which command correctly configures a branch protection rule to require the status check named 'ci/build' on branch 'main' using GitHub CLI?
Agh api repos/:owner/:repo/branches/main/protection -X PUT -f required_status_checks.contexts='["ci/build"]' -f required_status_checks.strict=true
Bgh branch protect main --require-status-checks ci/build
Cgit config branch.main.protection.required_status_checks ci/build
Dgh repo set-branch-protection main --status-check ci/build
Attempts:
2 left
💡 Hint
GitHub CLI uses 'gh api' to call REST endpoints for advanced settings.
Troubleshoot
advanced
2:00remaining
Why does a pull request merge button stay disabled despite passing all checks?
You have required status checks enabled on branch 'develop'. All checks show green, but the merge button is still disabled. What is the most likely cause?
AThe branch protection rule requires the branch to be up to date with 'develop' before merging.
BThe user does not have write permissions to the repository.
CThe status checks are not configured as required in branch protection.
DThe pull request is from a fork and cannot be merged.
Attempts:
2 left
💡 Hint
Check if the branch protection requires the branch to be updated before merging.
Best Practice
expert
2:30remaining
What is the best practice for required status checks in a team with multiple CI pipelines?
Your team uses multiple CI pipelines for different tests (unit, integration, lint). How should you configure required status checks for the main branch?
ARequire only one randomly selected CI pipeline to pass.
BRequire only the fastest CI pipeline to pass to speed up merges.
CRequire no status checks and rely on manual code review only.
DRequire all individual CI pipeline checks to pass before merging.
Attempts:
2 left
💡 Hint
Think about ensuring code quality and stability with multiple tests.