Git: Working with a remote

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


A remote is a clone of your repository, positioned on another machine.

GitHub is one of the most commonly used remotes.

If you have an existing repository, you can publish it on GitHub.

The procedure involves creating a repository on the platform, through their web interface, then you add that repository as a remote, and you push your code there.

To add the remote type

git remote add origin https://github.com/YOU/REPONAME.git

An alternative approach is creating a blank repo on GitHub and cloning it locally, in which case the remote is automatically added for you

Once you’re done, you can push your code to the remote, using the syntax git push <remote> <branch>, for example:

git push origin main

You specify origin as the remote, because you can technically have more than one remote. That is the name of the one we added previously, and it’s a convention.

The same syntax applies to pulling:

git pull origin main

tells Git to pull the main branch from origin, and merge it in the current local branch.

Lessons in this unit:

0: Introduction
1: Installing Git
2: Initialize a repository
3: Commit changes
4: Branches
5: Push and pull
6: ▶︎ Working with a remote
7: Solving conflicts
8: .gitignore
9: How to add a Git remote
10: How to remove a Git remote
11: How to set GitHub credentials for macOS