Add or Set Remote URL
To add a remote repository to a existing git project or to update the existing rep
Note:- You can create a local git repo with "git init" command. Then you wont have the remote repository set. In that case you can add a remote repository with the following command.
git remote add origin https://github.com/USERNAME/REPOSITORY.git
-- or --
git remote add origin [email protected]:USERNAME/REPOSITORY.gitIf you want to change the url of an existing remote repository:
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
-- or --
git remote set-url origin [email protected]:USERNAME/REPOSITORY.gitTo find remote repo
git remote -vhttps://stackoverflow.com/questions/42830557/git-remote-add-origin-vs-remote-set-url-origin
Last updated
Was this helpful?