Which command adds a remote named origin?

git add remote origin URL
git remote add origin URL
git remote set-url origin URL

What does -u do in git push -u origin main?

Pushes tags as well
Sets upstream so future git push/pull know the default remote/branch
Unstages local changes

Which command updates your local refs without merging?

git fetch
git pull
git clone

What is the difference between git pull and git fetch?

There is no difference
pull = fetch + merge (or rebase), fetch only downloads
fetch deletes local branches

How do you change the URL of an existing remote named origin?

git remote add origin NEW_URL
git remote set-url origin NEW_URL
git set remote origin NEW_URL