- 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.
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 remote repository shortname | git remote |
List remote repository shortname with url | git 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