Bird
0
0

What does the command git push origin --delete feature1 do?

easy📝 Conceptual Q11 of 15
Git - Remote Repositories
What does the command git push origin --delete feature1 do?
ADeletes the remote branch named 'feature1' from the origin repository.
BDeletes the local branch named 'feature1'.
CDeletes all branches except 'feature1' on the remote.
DRenames the remote branch 'feature1' to 'origin'.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command structure

    The command uses git push with origin to interact with the remote repository named 'origin'.
  2. Step 2: Interpret the --delete flag

    The --delete flag tells Git to remove the specified branch from the remote repository.
  3. Final Answer:

    Deletes the remote branch named 'feature1' from the origin repository. -> Option A
  4. Quick Check:

    Deleting remote branch = git push origin --delete branch-name [OK]
Quick Trick: Use 'git push origin --delete branch' to remove remote branches [OK]
Common Mistakes:
  • Confusing remote branch deletion with local branch deletion
  • Using 'git branch -d' which deletes local branches only
  • Thinking '--delete' renames branches
  • Assuming it deletes all branches

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes