0
0
Gitdevops~5 mins

Handling PR feedback and updates in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Pull Request (PR) in Git?
A Pull Request is a way to ask team members to review and merge your code changes into the main project branch. It helps keep code organized and reviewed before adding it.
Click to reveal answer
beginner
How do you update your PR branch after receiving feedback?
You make changes locally, commit them, and then push the updates to the same branch. The PR will automatically update with your new commits.
Click to reveal answer
intermediate
What command do you use to fetch the latest changes from the main branch before updating your PR branch?
Use `git fetch origin` to get the latest changes, then `git rebase origin/main` to apply your changes on top of the updated main branch.
Click to reveal answer
intermediate
Why is it important to rebase your PR branch before merging?
Rebasing keeps your branch up to date with the main branch and creates a clean, linear history. This makes it easier to review and avoids merge conflicts.
Click to reveal answer
beginner
How do you respond to feedback that requires multiple changes?
Make each change in your local branch, commit them with clear messages, and push all commits to the PR branch. This keeps feedback organized and easy to track.
Click to reveal answer
What happens when you push new commits to a branch with an open PR?
AThe PR closes automatically.
BYou must create a new PR for the new commits.
CThe new commits are ignored.
DThe PR updates automatically with the new commits.
Which command updates your local branch with the latest changes from the main branch?
Agit rebase origin/main
Bgit push origin main
Cgit clone main
Dgit commit --amend
Why should you keep commit messages clear when updating a PR?
ATo make the commit history confusing.
BTo help reviewers understand what changed.
CTo avoid pushing changes.
DTo delete previous commits.
What is the best practice if your PR branch has conflicts with the main branch?
APush your branch without resolving conflicts.
BDelete your branch and start over.
CRebase your branch onto the main branch and resolve conflicts.
DIgnore the conflicts and merge anyway.
How do you handle multiple rounds of feedback on a PR?
AMake changes, commit, and push updates to the same PR branch.
BClose the PR and open a new one for each change.
CIgnore the feedback.
DDelete your branch after each change.
Explain the steps to update your PR branch after receiving feedback.
Think about how you work on your computer and share changes with your team.
You got /4 concepts.
    Describe why rebasing your PR branch before merging is helpful.
    Imagine organizing papers in a neat stack before handing them over.
    You got /4 concepts.