0
0
Gitdevops~20 mins

Handling PR feedback and updates in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
PR Feedback 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 this git command after updating a PR branch?
You have a branch named feature checked out. You run git pull origin feature after pushing changes to update your local branch. What will this command output if your local branch is already up to date?
Git
git pull origin feature
AAlready up to date.
Berror: Your local changes to the following files would be overwritten by merge:
CMerge made by the 'recursive' strategy.
Dfatal: Couldn't find remote ref feature
Attempts:
2 left
💡 Hint
Think about what git says when no new changes are fetched or merged.
🔀 Workflow
intermediate
2:00remaining
Which git workflow step correctly updates a PR branch after feedback?
You received feedback on your pull request and made changes locally on your feature branch. What is the correct sequence to update the remote PR branch with your new commits?
Agit add . → git push origin feature → git commit -m 'fix'
Bgit commit -m 'fix' → git add . → git push origin feature
Cgit push origin feature → git add . → git commit -m 'fix'
Dgit add . → git commit -m 'fix' → git push origin feature
Attempts:
2 left
💡 Hint
Remember the order: stage changes, commit, then push.
Troubleshoot
advanced
1:30remaining
What error occurs if you try to push to a PR branch without committing changes?
You modified files locally but forgot to commit. You run git push origin feature. What error will git show?
Aerror: failed to push some refs to 'origin'
BEverything up-to-date
Cfatal: You have not concluded your merge (MERGE_HEAD exists).
Dfatal: The current branch feature has no upstream branch.
Attempts:
2 left
💡 Hint
Think about what git pushes when no new commits exist.
🧠 Conceptual
advanced
2:00remaining
What is the best practice to keep your PR branch updated with the main branch before pushing changes?
You want to update your PR branch feature with the latest changes from main before pushing your fixes. Which command sequence is best?
Agit checkout main → git pull origin main → git checkout feature → git merge main
Bgit checkout feature → git pull origin main
Cgit checkout feature → git rebase origin main
Dgit checkout main → git merge feature
Attempts:
2 left
💡 Hint
You want to update main first, then merge it into your feature branch.
Best Practice
expert
2:30remaining
Which git command safely updates a PR branch by replaying your commits on top of the latest main branch?
You want to update your PR branch feature with the latest main branch changes, keeping a clean history by replaying your commits. Which command do you use?
Agit merge main
Bgit cherry-pick main
Cgit rebase main
Dgit pull origin main --no-rebase
Attempts:
2 left
💡 Hint
Rebasing replays commits on top of another branch.