Topic: change local repo to use codeberg

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48 UTC+1.0
Posts: 2769
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2025-12-18, 16:49 UTC+1.0

I want to switch my local repos of widelands and website to use codeberg instead of github. What should i consider?

Is it save to just edit the repo/.git/config and change the remote urls for the remotes? e.g.:

from

git@github.com:USERNAME/widelands-website.git

to:

git@codeberg.org:USERNAME/widelands-website.git
Edited: 2025-12-18, 16:49 UTC+1.0

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07 UTC+1.0
Posts: 2241
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2025-12-18, 19:12 UTC+1.0

Better than editing the config by hand you can use the builtin subcommand git remote set-url

git remote set-url REMOTE_NAME git@codeberg.org:USERNAME/widelands-website.git
Edited: 2025-12-18, 19:12 UTC+1.0

Top Quote
tothxa
Avatar
Joined: 2021-03-24, 12:44 UTC+1.0
Posts: 567
OS: antiX / Debian
Version: some new PR I'm testing
Ranking
One Elder of Players
Posted at: 2025-12-18, 19:12 UTC+1.0

You can have multiple remotes for a repo with git, so you don't have to remove github to add codeberg.


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48 UTC+1.0
Posts: 2769
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2025-12-18, 20:03 UTC+1.0

tothxa wrote

You can have multiple remotes for a repo with git, so you don't have to remove github to add codeberg.

Yes, in know. But to get not confused i have to use special names for the remote-names, say cb-upstream and gh-upstream. Probably i have to get used to this... but actually i don't want to use github anymore. A sort of principle: either use this or that, but not both ;)

Will bunnybot not get confused when pushing one time to github and another time to codeberg, maybe on the same branch?


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07 UTC+1.0
Posts: 2241
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2025-12-18, 20:26 UTC+1.0

kaputtnik wrote

Will bunnybot not get confused when pushing one time to github and another time to codeberg, maybe on the same branch?

Bunnybot can handle this fine. Just please don't push different things to both mirrors of the same branch at the same time (plus or minus fifteen minutes) – in that case bunnybot will make a best-effort attempt (if even possible) to re-merge the divergence in a way that may or may not be what you intended :)

Note that for branches from a fork, the mirrored branches are namespaced with a mirror/AUTHOR/REPO/ prefix to their name to prevent naming clashes if multiple users' forks contain branches with the same name. (E.g. if user example-user makes a PR directly from his master branch, that would be mirrored under the name mirror/example-user/widelands-website/master).
This only applies to forks, branches in the upstream repo are mirrored with their names unchanged (master to master, 416_uniform_feeds to 416_uniform_feeds, etc.)


Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48 UTC+1.0
Posts: 2769
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2025-12-19, 10:31 UTC+1.0

Thank you all for the hints and explanations. Didn't expected this is that easy.

If anyone else want to switch keep in mind that you have to use the name of the repositories, e.g. codeberg.org/wl/widelands-website.git. So i did for my personal repository (origin):

git remote set-url origin git@codeberg.org:USERNAME/widelands-website.git

and for the main repository (upstream):

git remote set-url upstream git@codeberg.org:wl/widelands-website.git

Check with git fetch --all -p if all is fine.

Edited: 2025-12-19, 11:48 UTC+1.0

Top Quote