Wednesday, 26 November 2025

git remote add

The git remote add command is used to link you local Git repository to a remote repository (e.g. on GitHub, GitLab or BitBucket).

Syntax:
git remote add <name> <url>

name is the name (alias) you are giving to that remote. By convention, the main remote is called origin. Hence you will see commonly:

git remote add origin https://github.com/username/my-project.git

Note that my-project should be pre-created from within GitHub using New Repository.

No comments: