GitHub change/set remote URL

Check it:

git remote -v
origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
origin  https://github.com/USERNAME/REPOSITORY.git (push)

Use SSH style:

git remote set-url origin git@github.com:USERNAME/OTHERREPOSITORY.git

Drop local changes then pull (useful after changing name):

git fetch origin
git reset --hard origin/master

Leave a Reply

Your email address will not be published.