Quick bash script to replace repos on github with the SFC "Give Up GitHub" README.md
Find a file
2025-10-21 22:56:58 -04:00
LICENSES Enflake 2025-09-13 20:15:30 -04:00
nix nixfmt 2025-10-21 22:49:29 -04:00
.git-blame-ignore-revs Prior commit was a reformat 2025-10-21 22:54:50 -04:00
flake.lock Add treefmt for Nix 2025-10-21 22:52:32 -04:00
flake.lock.license Enflake 2025-09-13 20:15:30 -04:00
flake.nix Add shfmt to treefmt with default indent 2025-10-21 22:56:58 -04:00
giveupgithub.sh Run shfmt 2025-10-21 22:54:30 -04:00
README.md Enflake 2025-09-13 20:15:30 -04:00
README.template.md Support multiple forges 2025-09-02 22:42:16 -04:00

Give Up GitHub (The Musical The Script)

If you have a lot of projects to update on Github, this script may be useful.

(See Software Freedom Conservancy's Give Up GitHub site for details.)

Logo of the GiveUpGitHub campaign

Usage

Read and understand the script before running it. You may need to edit it or the template README.template.md to suit your needs.

Environment variables

Variable Default Purpose
SRCACCT librecast The source account or org on GitHub
SRCHOST github.com gist.github.com triggers Gist support
DSTACCT librecast The destination account or org on the target host
DSTHOST codeberg.org The destination host
DSTFORGE derived from $DSTHOST A friendly name of the destination host
GITHUB_TOKEN Result of gh auth token A GitHub token to set the repository archive flag

What it does

  1. Unarchive the repository on GitHub, in case previously archived
  2. Generates the README.md from the template and environment
  3. Replaces the head of the default branch with just the README.md
  4. Pushes the commit to GitHub
  5. Sets the description to $DSTFORGE
  6. Sets the homepage to the new git repository1
  7. Archives the repository on GitHub

Comparison to original

This is a fork of a "quick hack" to move Librecast's projects.

That Librecast version removes all branches and tags, leaving just the single commit. That is a more forceful protest2, but also more harmful to your dependents' builds. The correct trade-off is up to you, and may even vary by repository.

The Librecast version does not alter the archive status of the repository.

This version floats a smaller version of the logo, to keep more focus on the text. The same trick does not appear to work on Forgejo.

This version supports Gists.

License

The work as a whole is licensed =GPL-3.0-only=. Some components are licensed more permissively, as marked.


  1. does not apply to gists ↩︎

  2. pun intended ↩︎