Create a Spork

How to set up a floating-branch soft-fork (“spork”) of a mirrored upstream project using mise run spork-create.

Prerequisites

  • Mirror already exists at mirrors/<project> on forge (see manage-forgejo-mirrors)
  • 1Password CLI authenticated (op CLI)
  • SSH access to forge.ops.eblu.me:2222

Create the spork

mise run spork-create kingfisher

This will:

  1. Fork mirrors/kingfishereblume/kingfisher on forge
  2. Create a blumeops branch from upstream’s main branch
  3. Remove any upstream .forgejo/ directory (if present)
  4. Add .forgejo/workflows/mirror-sync.yaml and commit it
  5. Set blumeops as the default branch
  6. Clone to ~/code/3rd/kingfisher with three remotes: origin, mirror, upstream

Options:

mise run spork-create kingfisher --dry-run          # preview only
mise run spork-create kingfisher --no-clone         # skip local clone
mise run spork-create kingfisher --main-branch dev  # override branch name

Verify the setup

cd ~/code/3rd/kingfisher
git remote -v
# origin   ssh://forgejo@forge.ops.eblu.me:2222/eblume/kingfisher.git (fetch)
# mirror   ssh://forgejo@forge.ops.eblu.me:2222/mirrors/kingfisher.git (fetch)
# upstream https://github.com/mongodb/kingfisher.git (fetch)
 
git branch -a
# * blumeops
#   remotes/origin/blumeops
#   remotes/origin/main

What happens next

The mirror-sync workflow runs daily at 05:00 UTC and:

  • Fast-forwards main from the mirror
  • Rebases blumeops on top of main
  • Rebases any feature/local/* and feature/upstream/* branches
  • Rebuilds the deploy branch (all features merged)

See manage-spork-branches for working with feature branches.

Terminology

TermMeaning
originYour mutable fork at eblume/<project> on forge
mirrorRead-only upstream mirror at mirrors/<project> on forge
upstreamCanonical upstream repository (e.g., GitHub)
mainClean upstream tracking branch (may be named master, dev, etc.)
blumeopsDefault branch — upstream + local workflows/tooling
deployBuild artifact branch — everything merged, used for deployments

See also