SAGARFIVE

1. Introduction

2. Git Basics

3.  Git Terminology

4.  Git Branching

5.  Git - Github

6.  Git Add (Git staging)

7.  Git Commit

8.  Github Advanced

9.  Git Remote

8.7 Git origin

  • In Git, “origin” is a short name for the remote repository that a project was originally cloned from.
  • it is used instead of that original repository’s URL – and thereby makes referencing much easier.

Creating remote origin :

git remote add origin <repository url>
git remote add origin https://github.com/sagarfive/nature-website

We can also use other names for repository shortname

git remote add origin <repository-url>
git remote add origin-nature-new https://github.com/sagarfive/nature-new.git

List the remote repository:

List remote repository shortnamegit remote
List remote repository shortname with urlgit remote -v

Task – 1 : Creating Additional remote url with shortname and upload one repository code to newly added remote url

(i) Creating a new repository for remote repository url, copy it

(ii) Cloned my own repository in gitbash for code

(iii) Checking its remote url

(iv) Adding the new remote url and pushing the changes to new repository

(Adding changes/files/code from nature-website → nature-new repository)

(v) Checking the new repository, code is pushed , this way multiple remote url used