-
Notifications
You must be signed in to change notification settings - Fork 75
start github-and-away tech note #1167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mpadge
wants to merge
15
commits into
ropensci:main
Choose a base branch
from
mpadge:github-and-away
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5af72af
start github-and-away tech note
mpadge fe41272
more github-and-away text
mpadge 0553458
Merge branch 'main' into github-and-away
mpadge 3d0e8e6
update index in response to comments from @Aariq @adamhsparks @maelle
mpadge 7c7f451
add git diagram and more github-and-away text
mpadge ce4b6e7
Merge branch 'main' into github-and-away
mpadge 787ddd1
add info on transferring issues, prs
mpadge 5d8010d
add a lot more detail on syncing and maintaining mirrors
mpadge d513ded
add excellent suggestions from @dgkf - thank you so much\!
mpadge 5363b06
Merge branch 'main' into github-and-away
mpadge 638464b
edit final section and recommend mirroring to non-ropensci locations
mpadge b0272a8
add editors list
mpadge 3d6629c
update folder name 10-17 -> 11-07
mpadge 7fb2a13
add words of warning sub-section
mpadge 3f18f57
Edits to git mirroring post
noamross File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+131 KB
content/blog/2025-10-17-github-and-away/codeberg-migration-options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| --- | ||
| title: Code hosting options beyond GitHub | ||
| author: | ||
| - Mark Padgham | ||
| editor: | ||
| date: '2025-10-17' | ||
| slug: beyond-github | ||
| description: How to manage and mirror code repositories across different platforms. | ||
| output: hugodown::md_document | ||
| tags: | ||
| - tech notes | ||
| params: | ||
| doi: "" | ||
| --- | ||
|
|
||
| rOpenSci peer-review has to date been exclusively conducted [on GitHub](https://github.com/ropensci/software-review/issues?q=sort%3Aupdated-desc%20is%3Aissue%20state%3Aclosed). | ||
| We are not planning on moving away from this system any time soon, but are nonetheless aware that many people prefer alternative platforms. | ||
| rOpenSci also has an organization presence on [gitlab.com/ropensci](https://gitlab.com/ropensci) and [codeberg.org/ropensci](https://codeberg.org/ropensci). | ||
| This post describes how rOpenSci community members can use these alternative platforms. | ||
|
|
||
| ## Code (still) needs a single home | ||
|
|
||
| All platforms described here are based on [git](https://git-scm.com/), which is a _centralized_ version control system (in contrast to decentralized version control systems such as [darcs](https://darcs.net/) or [pijul](https://pijul.org/)). | ||
mpadge marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This means that managing code with git generally requires identifying a single, main version to which changes can be _pushed_, or from which changes can be _pulled_. | ||
| There is thus a single connection between code on your local machine and this single main version. | ||
|
|
||
| Code can of course be hosted anywhere, and we aim here to show how easy it is to mirror a repository on an arbitrary number of platforms. | ||
| Hosting code in multiple locations creates multiple connections between local and remote versions. | ||
| This can easily create conflicts in git. | ||
| To keeps things simple, this post will therefore presume that every repository maintains a single home, with all other platforms mirroring changes from that site via `git push` only. | ||
|
|
||
| ## Mirroring to other platforms | ||
|
|
||
| ### Mirroring on codeberg | ||
|
|
||
| The easiest platform on which to mirror your code is currently [Codeberg](https://codeberg.org), which has inbuilt options to mirror repositories directly from a large number of other platforms, including GitHub. | ||
| [Codeberg](https://codeberg.org) can also mirror all issues and pull requests, although the contributors will no longer be hyperlinked (see an [example here](https://codeberg.org/ropensci/osmdata/issues/388)). | ||
| To mirror a repo on Codeberg, click the large "+" button on the top right of the main menu bar, and select "New migration", like this: | ||
|
|
||
|  | ||
|
|
||
| That will then open up the following grid of options from where you want to mirror your repository: | ||
|
|
||
| {{< figure src = "codeberg-migration-options.png" alt = "Codeberg new migration button." class = "pull-left" caption = "Codeberg new repository migration button.">}} | ||
|
|
||
|  | ||
|
|
||
| To migrate from GitHub, click the symbol to open a migration to fill in some details, where you can also paste a GitHub token into "access token", and mirror almost all other aspects, including issues, pull requests, and releases. | ||
| Note that the migration process may take 10 minutes or more. | ||
| You'll also need to update your local `git` configuration to add the new remote destination, as described in the following sub-section. | ||
|
|
||
| ### Mirroring elsewhere | ||
|
|
||
| No other platforms currently offer the one-click mirror functionality of Codeberg. | ||
| To mirror in all other cases, you'll need to: | ||
| 1. Create a new repository on the desired platform. | ||
| 2. Set a `git remote` URL to the new destination. | ||
| 3. `git push` to new remote. | ||
|
|
||
| The [git remote web page](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) provides more detail on working with remotes. | ||
|
|
||
| ## Managing one repository across multiple platforms | ||
|
|
||
| With due apologies for repeittion, git is a centralised version control system, and is thus not the best system for managing multiple remote sources. | ||
mpadge marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| The best way to manage one git repository across multiple platforms is to use one main source to which you `push`, and from where you may `pull`. | ||
mpadge marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| All other remote origins should be considered `push` mirrors only, and never `pull`. | ||
| In the rare case that conflicts from other sources arise, you may need to `git push --force` to _other_ remotes (or the [safer version of `git push --force-with-lease`](https://git-scm.com/docs/git-push#Documentation/git-push.txt---force-with-leaserefnameexpect)). | ||
| You should never `git push --force` to your main source. | ||
mpadge marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For each additional remote source, you'll need to add a remote URL with [`git remote add`](https://git-scm.com/docs/git-remote). | ||
| In a standard set up, this will still require you to explicitly `git push` to each individual remote. | ||
| The pure git way of managing multiple remote sources is to take advantage of `git remote set-url --add` to add additional URLs to a single remote identifier. | ||
| Consistent with advice throughout this post, it is not recommended to update your _main_ remote URL with `set-url --add`. | ||
| A better option would be to initially create a remote like `git remote add other https://codeberg.org/ropensci/my-package`. | ||
| You can then extend that with each additional remote URL with `set-url --add`. | ||
| Running `git push other <branch>` will then push that branch to all remote URLs specified in `other`. | ||
|
|
||
| More arcane alternatives include my own [arcane git push bash script](https://github.com/mpadge/dotfiles/blob/main/system/gitpush.bash) which recreates the now obsolete push-by-password functionality of GitHub, while also pushing to all other listed remote sources. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.