- The git remote command used to create, view, and delete particulars in remote repositories.
- Remote repository is stored on a code hosting service like an internal server, GitHub, Subversion, and more.
Check remote repository | git remote | |
Check remote repository URL | git remote -v | |
Adding remote repository | git remote add <short name><remote URL>git remote add origin-git https://github.com/sagarfive/git.git | |
Adding another repository | git remote add <short name><remote URL> git remote add origin-shellscript https://github.com/sagarfive/Shell-scripting | |
Pushing to remote repo | git remote push https://github.com/sagarfive/git orgit push origin main |
Task – 1 : Git remote – clone a github repo and checking the remote origin details
Task – 2 : 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