# 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 [email protected]:petterhoel/blog.git
[email protected]:petterhoel/blog.git

List your new remote to verify

> git remote -v
origin [email protected]:petterhoel/blog.git (fetch)
origin [email protected]:petterhoel/blog.git (push)
Last updated: April 15th 2024