Challenge - 5 Problems
Remote Branch Deletion Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of deleting a remote branch?
You run the command
git push origin --delete feature-xyz. What will be the output if the branch feature-xyz exists on the remote?Git
git push origin --delete feature-xyzAttempts:
2 left
💡 Hint
Deleting a remote branch shows a message with [deleted] if successful.
✗ Incorrect
The command
git push origin --delete branch-name deletes the branch on the remote and outputs a line with [deleted].❓ Troubleshoot
intermediate2:00remaining
Why does deleting a remote branch fail?
You run
git push origin --delete hotfix but get the error: error: unable to delete 'hotfix': remote ref does not exist. What is the most likely cause?Git
git push origin --delete hotfixAttempts:
2 left
💡 Hint
The error says 'remote ref does not exist'.
✗ Incorrect
This error means the branch you want to delete is not found on the remote, so deletion cannot happen.
🔀 Workflow
advanced3:00remaining
Correct sequence to delete a remote branch safely
Arrange the steps in the correct order to safely delete a remote branch named
feature-abc:Attempts:
2 left
💡 Hint
You must confirm the branch exists before deleting and avoid deleting the branch you are currently on.
✗ Incorrect
First verify the remote branch exists (2), then switch to a different local branch (1), delete the remote branch (3), and optionally delete the local branch (4).
✅ Best Practice
advanced2:00remaining
Best practice for deleting remote branches in a team
Which practice is best when deleting remote branches in a shared repository?
Attempts:
2 left
💡 Hint
Think about teamwork and communication.
✗ Incorrect
Informing your team prevents confusion and accidental loss of work when deleting shared branches.
🧠 Conceptual
expert2:00remaining
What happens to local branches after deleting the remote branch?
You delete a remote branch
release using git push origin --delete release. What is the state of your local branch named release after this command?Attempts:
2 left
💡 Hint
Deleting a remote branch does not affect local branches automatically.
✗ Incorrect
Deleting a remote branch only removes it from the remote. Local branches remain until manually deleted.