What is the use of git remote add origin?
Also know, what does git remote add origin do?
The name of the remote is simply an identifier so you can specify which remote repo to be used in other commands (e.g. git push, pull, fetch, etc.). When you clone a repository, a link to the original link where you clone from will be added with the name "origin" (e.g. "git remote add origin <url>").
Also, what is git add origin?
"origin" is the local name of the remote repository. you can use any name instead of "origin". For example: git remote add myorigin git@github.com:user/repo.git git remote set-url myorigin https://github.com/user/repo.git. References from github: remote add, remote set-url.
If you've copied a project from Github, it already has an origin. You can view that origin with the command git remote -v, which will list the URL of the remote repo.