Recall & Review
beginner
What does the command
git remote add origin <url> do?It adds a new remote repository named 'origin' pointing to the specified URL. This lets you connect your local repository to a remote one for pushing and pulling changes.
Click to reveal answer
beginner
Why is the remote name usually called 'origin'?
'origin' is the default name Git uses for the main remote repository. It's a simple convention to identify the original source repository.
Click to reveal answer
beginner
How can you check the remote repositories linked to your local Git repo?
Use the command
git remote -v. It lists all remote names and their URLs.Click to reveal answer
intermediate
What happens if you run
git remote add origin <url> but 'origin' already exists?Git will show an error saying the remote 'origin' already exists. You need to remove or rename the existing remote before adding a new one with the same name.
Click to reveal answer
beginner
How do you remove a remote named 'origin'?
Use the command
git remote remove origin to delete the remote named 'origin' from your local repository.Click to reveal answer
What is the purpose of
git remote add origin <url>?✗ Incorrect
The command adds a remote named 'origin' pointing to the given URL, linking your local repo to a remote one.
Which command shows the URLs of all remotes in your Git repo?
✗ Incorrect
git remote -v lists all remotes with their URLs.If you want to change the URL of the remote 'origin', what should you do?
✗ Incorrect
Use
git remote set-url origin <new-url> to update the URL of an existing remote.What error occurs if you add a remote named 'origin' twice?
✗ Incorrect
Git prevents duplicate remote names and shows an error if 'origin' already exists.
Which command removes the remote named 'origin'?
✗ Incorrect
git remote remove origin deletes the remote named 'origin'.Explain what the command
git remote add origin <url> does and why it is important.Think about connecting your local work to a place online.
You got /3 concepts.
Describe how to check existing remotes and how to fix an error when adding a remote named 'origin' that already exists.
Check what remotes you have, then remove or rename if needed.
You got /3 concepts.