Working With a Remote
A remote is another copy of the repository. git remote add names it, git push -u uploads and sets the upstream, and git branch -r lists remote branches.
Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git init -q --bare -b main ../origin.git
git remote add origin ../origin.git
git push -q -u origin main
git remote
git branch -rResult
origin origin/main
Exercise
Add a remote.
git remote origin url
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.