# Git: git remote add command

#### Software Engineering git version control

Get FREE domain for 1st year and build your brand new site

git remote add command is a basic git command which add a remote repository as an origin of your local repository. The basic idea is that the remote repository is the final working repository which is considered by everyone and your local repository is your local copy holding your changes.

### Introduction

Using the command git remote -v, we can find out the remote repository for your local repository. As we have not added any remote origin repository, it will provide no information.

There are two types of remote repositories:

• remote fetch: the remote repository which you use as a baseline upon which you make your local changes
• remote push: the remote repository where you add your local changes

Usually, both remote repositories refer to different branches of the same repository like remote fetch is usually master branch and remote push is a feature branch like feature_1. In some cases, both can refer to the same branch as well. It is related to how the repository is being managed.

The concept is covered by this image:

Let us consider this repository https://github.com/OpenGenus/test as our origin repository. Let us add it to our local repository. The format of the command is:

git remote add <name_of_your_remote_repository> <URL_of_your_remote_repository>


As we see, we have successfully add our GitHub repository as our remote repository.

We can, now, do much more interesting things with our repository and we have made your first step towards the distributed layer of Git.

#### OpenGenus Foundation

The official account of OpenGenus IQ backed by GitHub, DigitalOcean and Discourse

Vote for OpenGenus Foundation for Top Writers 2021:

Improved & Reviewed by: