0
0
Gitdevops~20 mins

Pull request process in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pull Request Pro
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this git command after pushing a branch?
You run the following commands:
git checkout -b feature-xyz
git push origin feature-xyz

What is the typical output message you will see after the push completes successfully?
Git
git checkout -b feature-xyz
git push origin feature-xyz
ASwitched to a new branch 'feature-xyz'\nEverything up-to-date
Bfatal: remote origin already exists.
CEnumerating objects: 5, done.\nCounting objects: 100% (5/5), done.\nDelta compression using up to 8 threads\nCompressing objects: 100% (3/3), done.\nWriting objects: 100% (3/3), 300 bytes | 300.00 KiB/s, done.\nTotal 3 (delta 0), reused 0 (delta 0)\nremote: Resolving deltas: 100% (0/0), done.\nTo github.com:user/repo.git\n * [new branch] feature-xyz -> feature-xyz
Derror: failed to push some refs to 'origin'
Attempts:
2 left
💡 Hint
Think about what git shows when a new branch is pushed to the remote.
🧠 Conceptual
intermediate
1:30remaining
What is the main purpose of a pull request in Git workflows?
Choose the best description of why teams use pull requests.
ATo merge code changes directly to the main branch without review.
BTo request feedback and review before merging code changes into a shared branch.
CTo delete branches that are no longer needed.
DTo create a backup of the repository on a remote server.
Attempts:
2 left
💡 Hint
Think about collaboration and quality control in teams.
🔀 Workflow
advanced
2:30remaining
What is the correct sequence of commands to create a pull request branch, push it, and open a pull request on GitHub CLI?
Arrange the following commands in the correct order to create a feature branch, push it to origin, and open a pull request using GitHub CLI.
A1,4,2,3
B1,2,4,3
C4,1,2,3
D1,4,3,2
Attempts:
2 left
💡 Hint
Remember you must commit changes before pushing, and open the PR after pushing.
Troubleshoot
advanced
1:30remaining
What error will you see if you try to push a branch without permission to the remote repository?
You run:
git push origin feature-branch

but you do not have write access to the remote repo. What error message will git show?
Aerror: failed to push some refs to 'origin'\nfatal: unable to access 'https://github.com/user/repo.git/': The requested URL returned error: 403
Bfatal: remote origin already exists.
CEverything up-to-date
Dfatal: not a git repository (or any of the parent directories): .git
Attempts:
2 left
💡 Hint
403 error means forbidden access.
Best Practice
expert
2:00remaining
Which option best describes a recommended practice before merging a pull request?
Select the best practice to ensure code quality before merging a pull request into the main branch.
ADelete the feature branch before merging to keep the repo clean.
BMerge immediately after opening the pull request to save time.
CForce push to the main branch to overwrite history.
DRun automated tests and have at least one team member review the code changes.
Attempts:
2 left
💡 Hint
Think about quality control and collaboration.