Bird
0
0

You want to add two remotes to your local Git repo: one named 'origin' for the main repo and another named 'backup' for a mirror. Which commands correctly add both remotes?

hard📝 Workflow Q8 of 15
Git - Remote Repositories
You want to add two remotes to your local Git repo: one named 'origin' for the main repo and another named 'backup' for a mirror. Which commands correctly add both remotes?
Agit remote add origin https://github.com/user/backup.git git remote add backup https://github.com/user/main.git
Bgit remote add https://github.com/user/main.git origin git remote add https://github.com/user/backup.git backup
Cgit remote set-url origin https://github.com/user/main.git git remote set-url backup https://github.com/user/backup.git
Dgit remote add origin https://github.com/user/main.git git remote add backup https://github.com/user/backup.git
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct syntax for adding remotes

    The syntax is git remote add <name> <url>.
  2. Step 2: Verify commands for both remotes

    git remote add origin https://github.com/user/main.git git remote add backup https://github.com/user/backup.git correctly adds 'origin' and 'backup' with their respective URLs.
  3. Final Answer:

    git remote add origin https://github.com/user/main.git git remote add backup https://github.com/user/backup.git -> Option D
  4. Quick Check:

    Add multiple remotes with separate 'git remote add' commands [OK]
Quick Trick: Add multiple remotes by repeating 'git remote add' with different names [OK]
Common Mistakes:
  • Swapping URL and name order
  • Using 'git remote set-url' before adding remote
  • Mixing URLs between remotes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Git Quizzes