Thursday, 2 November 2023

How to Change a Git Remote

I needed to change a remote, as the ip address of the remote server had changed.

$ git remote -v
origin ssh://mrbear@192.168.2.1:/home/mrbear/store (fetch)
origin ssh://mrbear@192.168.2.1:/home/mrbear/store (push)

So to change it:

git remote set-url origin ssh://mrbear@192.168.2.7:/home/mrbear/store

And it becomes:

$ git remote -v
origin ssh://mrbear@192.168.2.7:/home/mrbear/store (fetch)
origin ssh://mrbear@192.168.2.7:/home/mrbear/store (push)

References

CareerKarma - How to Change a Git Remote
https://careerkarma.com/blog/git-change-remote/

No comments:

Post a Comment