Bird
0
0

Which of the following is the recommended modern syntax to delete a remote branch named bugfix?

easy📝 Syntax Q12 of 15
Git - Remote Repositories
Which of the following is the recommended modern syntax to delete a remote branch named bugfix?
Agit push origin :bugfix
Bgit push origin --remove bugfix
Cgit branch -r -d bugfix
Dgit push origin --delete bugfix
Step-by-Step Solution
Solution:
  1. Step 1: Review valid commands for deleting remote branches

    The modern and clear syntax is git push origin --delete branch-name.
  2. Step 2: Check each option

    git push origin :bugfix uses an older syntax but is valid; however, the question asks for the recommended modern syntax, which is the explicit --delete flag. git push origin --remove bugfix uses a non-existent flag --remove. git branch -r -d bugfix deletes local remote-tracking branches, not remote branches.
  3. Final Answer:

    git push origin --delete bugfix -> Option D
  4. Quick Check:

    Correct syntax = git push origin --delete branch [OK]
Quick Trick: Use '--delete' flag with 'git push origin' to delete remote branch [OK]
Common Mistakes:
  • Using '--remove' instead of '--delete'
  • Confusing local branch deletion with remote
  • Using 'git branch -r -d' which only deletes local remote-tracking branches
  • Not specifying the remote name 'origin'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes