Bird
0
0

How can you delete the remote branches alpha, beta, and gamma in a single Git command?

hard📝 Application Q8 of 15
Git - Remote Repositories
How can you delete the remote branches alpha, beta, and gamma in a single Git command?
Agit branch -d alpha beta gamma
Bgit push origin :alpha :beta :gamma
Cgit push origin --delete alpha beta gamma
Dgit remote remove alpha beta gamma
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct syntax

    The modern and recommended way to delete multiple remote branches is using git push origin --delete followed by the branch names.
  2. Step 2: Analyze options

    git push origin --delete alpha beta gamma correctly lists multiple branches after --delete. git push origin :alpha :beta :gamma uses the older syntax but does not support multiple branches in one command. git branch -d alpha beta gamma deletes local branches. git remote remove alpha beta gamma removes remotes, not branches.
  3. Final Answer:

    git push origin --delete alpha beta gamma -> Option C
  4. Quick Check:

    Use --delete with multiple branch names to delete several remote branches [OK]
Quick Trick: Use --delete with multiple branches to delete them remotely [OK]
Common Mistakes:
  • Using git branch -d which deletes local branches only
  • Trying to delete multiple branches with colon syntax in one command
  • Confusing remote removal with branch deletion

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes