Recall & Review
beginner
What are branch protection rules in Git?
Branch protection rules are settings that prevent certain actions on important branches, like deleting or force-pushing, to keep the code safe and stable.
Click to reveal answer
beginner
Name one common restriction set by branch protection rules.
One common restriction is requiring pull request reviews before merging changes into the protected branch.
Click to reveal answer
beginner
Why is it important to protect the main branch in a repository?
Protecting the main branch helps avoid accidental changes or deletions that could break the project or lose important work.
Click to reveal answer
intermediate
How do branch protection rules improve team collaboration?
They enforce code reviews and tests before merging, ensuring everyone agrees on changes and the code stays reliable.
Click to reveal answer
intermediate
Can branch protection rules prevent force pushes? Explain.
Yes, branch protection rules can block force pushes to avoid overwriting history and losing work.
Click to reveal answer
What does a branch protection rule typically prevent?
✗ Incorrect
Branch protection rules often prevent direct pushes to ensure changes go through reviews.
Which of these is a common requirement in branch protection rules?
✗ Incorrect
Requiring pull request reviews helps maintain code quality.
What happens if you try to force push to a protected branch?
✗ Incorrect
Branch protection rules block force pushes to protect branch history.
Why protect the main branch in a Git repository?
✗ Incorrect
Protecting main keeps the project stable and safe from mistakes.
Which action is NOT controlled by branch protection rules?
✗ Incorrect
Branch protection rules do not control repository deletion.
Explain what branch protection rules are and why they are important in Git.
Think about how to keep important branches safe and stable.
You got /3 concepts.
Describe how branch protection rules help teams work better together.
Consider teamwork and quality control.
You got /4 concepts.