Git & GitHub
/Intermediate
Approvals & Merging
Definition
The final steps of a Pull Request workflow where reviewers formally accept the changes, and the code is subsequently integrated into the base branch.
Explain Like I'm New
Once you fix all the things your reviewers pointed out, they click a button that says 'Approve' (which adds a big green checkmark to your PR). Once you have enough approvals, the 'Merge' button unlocks, and you can squash your code into the main branch.
Real World Example
A company policy might require strictly 2 Approvals from Senior Developers before any code can be merged into the `production` branch.
Common Use Cases
- •Finalizing the PR process
Terminal Output
bash / terminal
// No code needed. This is a GitHub UI process.
// Step 1: Reviewer submits 'Approve' review.
// Step 2: PR Author sees the green checkmark.
// Step 3: PR Author clicks 'Squash and merge'.
// Step 4: GitHub merges the code and asks: 'Delete branch?'
// Step 5: ALWAYS click 'Delete branch' to keep the repository clean!
Interview Questions
basic
- What are the three statuses a reviewer can submit?
intermediate
- What is the difference between 'Create a merge commit' and 'Squash and merge'?