Follow

What would be a good way to maintain a repository on and , where the main development repo will be on Codeberg? For my own work I could probably work as usual on the Codeberg repo and then git push --mirror to GitHub after merging. But what about PRs from GitHub? Should I add the PR fork as a remote and then manually merge into Codeberg main branch, and then git push -- mirror to GitHub? Or are there better ways to achieve this?

@sigsegv that sounds completely reasonable. Provided you don't so any rebasing or anything after pulling the Github fork, Github should still be able to put together that the merge request is for the same commit as is now in master after you mirror it back, given they have the same hash.

In other words, it should work as long as you merge the commits in unchanged, and if you want any changes done on it, ask the PR author to make the changes in their fork first.

@sigsegv
That sounds reasonable.

If you run ci only on one service, you could mirror the PRs yourself. I'd advice to run CI on both, though, as this results in faster response times for your contributors. Just make sure that the checks of both ci systems are equal! 😊

@sigsegv Simply add two or more urls in the remote in question under `.git/config`:

[remote "origin"]
url = git@github.com:foo/bar.git
url = git@foobar.tld:foo/bar.git
fetch = +refs/heads/*:refs/remotes/origin/*

This will mirror everything to origin to both urls.

@epilys Nice! That should work fine for merging pull requests as well, as long as I do it from my machine (not through Codeberg GUI), right?

@sigsegv define on Github that it is just a pure mirror, and any patches against this repo need to be either pushed on Codeberg or send by mail for manual merge. I had a Github repo that worked this way, but I sadly can't remember which one it was. Point is communicate it clearly in the Readme how it works and stick with it. Might anger some people but those who really wanna submit some work to your repo will get along.

@grimneko Yes, I'll probably do this for most of them. But I'm not a big fan of moving active repos, so for my most active one I want to accept PRs both places.

@grimneko And thanks for the suggestion! I'll try to make it clear as you said :)

Sign in to participate in the conversation
FLOSS.social

For people who care about, support, or build Free, Libre, and Open Source Software (FLOSS).