git remote origin set code example

Example 1: get git remote url

git config --get remote.origin.url

Example 2: git set origin

git remote -v
 git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

Example 3: git set remote

git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

Example 4: set git origin

git remote add origin git@git.assembla.com:portfolio/space.space_name.git

Example 5: change remote to use ssh git command

git remote add origin git@github.com:nikhilbhardwaj/abc.git

Example 6: git set remote origin url

git remote set-url origin new.git.url/here