A remote is a version of your repository hosted somewhere else — almost always GitHub. Connecting one lets you back up your work and share it with others.


Creating a repository on GitHub

On GitHub, click 'New Repository,' give it a name, and choose whether it's public or private. GitHub gives you a unique URL for that repository afterward.

Linking local to remote

Add the GitHub URL as a remote named 'origin.' From then on, your local repository knows exactly where to send and receive updates.

Cloning an existing project

If a project already exists on GitHub, cloning downloads the entire repository — including its full history — onto your machine in one step.

>_ COMMANDS YOU'LL USE
git remote add origin https://github.com/user/repo.gitConnect your local repo to a GitHub repository
git remote -vView the remotes connected to your repository
git clone https://github.com/user/repo.gitDownload a complete copy of a remote repository
💡"origin" is just a conventional name for your main remote — you can name it anything, but almost everyone uses origin.
⚠️Common mistake: Making the wrong repo public