0
0
Gitdevops~10 mins

Required status checks in Git - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to list all branches in your Git repository.

Git
git [1]
Drag options to blanks, or click blank then click option'
Abranch
Bcommit
Cpush
Dclone
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' instead of 'git branch'.
Using 'git push' which uploads changes to remote.
Using 'git clone' which copies a repository.
2fill in blank
medium

Complete the command to enable required status checks on a branch named 'main'.

Git
gh api repos/:owner/:repo/branches/main/protection --method PATCH -f required_status_checks.strict=[1]
Drag options to blanks, or click blank then click option'
Anone
Btrue
Cnull
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'false' disables strict required status checks.
Using 'null' or 'none' is invalid here.
3fill in blank
hard

Fix the error in the command to require the status check named 'ci-test'.

Git
gh api repos/:owner/:repo/branches/main/protection/required_status_checks/contexts --method POST -f [1]='ci-test'
Drag options to blanks, or click blank then click option'
Acontext
Bchecks
Ccheck
Dcontexts
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural 'contexts' which is for the main protection endpoint.
Using 'check' or 'checks' are invalid field names.
4fill in blank
hard

Fill both blanks to create a JSON object that requires status checks 'build' and 'test'.

Git
{"required_status_checks": {"contexts": [[1], [2]]}}
Drag options to blanks, or click blank then click option'
A"build"
B"deploy"
C"test"
D"lint"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the status check names.
Choosing wrong status check names.
5fill in blank
hard

Fill all three blanks to complete the GitHub CLI command that sets required status checks 'build' and 'test' on branch 'develop'.

Git
gh api repos/:owner/:repo/branches/[1]/protection -f required_status_checks.contexts='[2],[3]'
Drag options to blanks, or click blank then click option'
Amain
Bbuild
Ctest
Ddevelop
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong branch name.
Mixing up the order of status checks.
Forgetting to separate status checks with a comma.