From fffefed2eccabe5dfcb732714c3f96edc4f01f99 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 22 Aug 2024 09:43:42 +0100 Subject: [PATCH] Git remotes can have more than one URL --- source/_notes/9.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 source/_notes/9.md diff --git a/source/_notes/9.md b/source/_notes/9.md new file mode 100644 index 0000000..3fcc96e --- /dev/null +++ b/source/_notes/9.md @@ -0,0 +1,15 @@ +--- +title: Git remotes can have more than one URL +date: 2024-08-22 09:43:42 +tags: [Software Development, Git] +--- + +If you want to have multiple URLs for a single remote so `git push origin ...` will push to multiple remotes, such as GitHub and GitLab, or a personal repository and a client repository, you can do `git remote set-url --add origin `. + +Then `git remote -v` should show something like this: + +```plain +origin git@github.com:opdavies/zet.oliverdavies.uk (fetch) +origin git@github.com:opdavies/zet.oliverdavies.uk (push) +origin git@gitlab.com:opdavies/zet.oliverdavies.uk.git (push) +```