# Changing your git remote

Once in a while me, or a college, needs to swap the pointer to origin. Say, switching from https to ssh. This is the gist of it.

List your existing remote

> git remote -v
https://github.com/petterhoel/blog.git

Delete your existing remote

> git remote remove origin
# git remote add <name> <url>
> git remote add origin git@github.com:petterhoel/blog.git
git@github.com:petterhoel/blog.git

List your new remote to verify

> git remote -v
origin git@github.com:petterhoel/blog.git (fetch)
origin git@github.com:petterhoel/blog.git (push)
Last updated: February 14th 2022