Typically a Git remote contains a single URL. For example, when we clone a repository, a remote named origin is automatically created and its URL is set to the location of the upstream repository. For example: $ git remote -v origin https://codeberg.org/spxy/spica.git (fetch) origin https://codeberg.org/spxy/spica.git (push) $ sed '/remote/,$!d' .git/config [remote "origin"] url = https://codeberg.org/spxy/spica.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "main"] remote = origin merge = refs/heads/main A perhaps less known detail is that we can set multiple URLs for a remote. For example: $ git remote set-url origin --add https://github.com/spxy/spica.git $ git remote -v origin https://codeberg.org/spxy/spica.git (fetch) origin https://codeberg.org/spxy/spica.git (push) origin https://github.com/spxy/spica.git (push) $ sed '/remote/,$!d' .git/config [remote "origin"] url = https://codeberg.org/spxy/spica.git fetch = +refs/heads/*:refs/remotes/origin/* url =…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.