2026-08-07POSSEI wanted to keep my code in multiple remotes.
github since it is still where everyone reaches to see what I'm doing.codeberg since it is my preferred forge.Apparently git supported multiple remotes for fetch and push, so this is how i configured my repo.
After initializing git and making some commits, I first added the two remotes:
github and codeberg respectively.
git remote add codeberg ssh://git@codeberg.org/user/project.git
git remote add github git@github.com:user/project.gitThen, I set up origin so that it fetches from codeberg but pushes to both codeberg and github.
To set the fetch URL to point to codeberg:
git remote add origin ssh://git@codeberg.org/user/project.gitThen, to add both codeberg and github as push URLs:
git remote set-url --add --push origin ssh://git@codeberg.org/scientiac/interpretingo.git
git remote set-url --add --push origin git@github.com:scientiac/interpretingo.gitTo verify that everything works properly I checked it by running the following command:
git remote show origin* remote origin
Fetch URL: ssh://git@codeberg.org/user/project.git
Push URL: ssh://git@codeberg.org/user/project.git
Push URL: git@github.com:user/project.git
HEAD branch: master
...
...Now, I have my project on both places so I can ignore github and enjoy the codeberg life.
A Computer Engineering student who loves FOSS and is learning about privacy, the Internet and languages writing about the things he does.