ht fork maintenance guidlelines #3
Unanswered
marksverdhei
asked this question in
ht-forks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
HT Fork Management Guide
This document describes how Heiervang Technologies maintains forks of upstream open-source projects.
Branch Structure
Each fork has two key branches:
htmainmainmain— Upstream Mirrormainbranchmaingit fetch upstream && git merge --ff-only upstream/mainhtht— Default Branchmainhtunless they're upstream contributionsCommit Hygiene
The
htbranch should maintain a clean, linear history of logical feature commits on top ofmain:Commit Message Convention
Scopes match the upstream project's module structure (e.g.,
qwen3-tts,serving,diffusion).Inspecting the Fork Delta
To see what HT-specific changes currently exist on top of upstream:
Run these before syncs and rewrites to audit the current state of HT changes.
Syncing with Upstream
When upstream
mainadvances:If the rebase is complex, create a backup branch first:
Sync Cadence
htonto the latestmainso your feature branch starts from a current baseAfter a Force-Push: Recovering Local Branches
When
htis force-pushed (after a rebase or rewrite), teammates with local branches based on the oldhtneed to reset:git fetch origin git checkout ht git reset --hard origin/ht # Rebase any local feature branches onto the new ht git checkout feat/my-feature git rebase htFeature Development
New Features
ht:htPR Checklist
Each fork should have a PR template with a checkbox:
README Convention
The
htbranch README should include an HT Fork Changes section near the top, documenting all changes relative to upstream. Group changes by feature area and annotate items that have been upstreamed:Using Draft PRs as Issues
Since GitHub Issues may be disabled on fork repos, use draft PRs to track RFC documents, design discussions, and work items:
docs/my-rfc)htThis gives us issue-like tracking with inline commenting, without needing GitHub Issues enabled.
History Rewrites
When the
htbranch history becomes messy (accumulated merge commits, fix-up commits, superseded changes), perform a history rewrite:Procedure
Create a protected backup branch:
Create a working branch from
main:Build clean commits by feature group. For each group:
ht:git checkout ht -- <file>Verify the final state matches:
git diff ht-rewrite..ht # Should be empty (or only intentionally dropped files)Force-push:
Clean up: Delete the working branch. Keep the backup branch as a safety net.
What to Drop During Rewrites
main(redundant after sync)Agent Safety Rules
When AI agents (Claude Code, Copilot, etc.) work on HT fork repositories:
main— it is an upstream mirror and should only be updated via fast-forward merge fromupstream/main.ht(notmain) when creating PRs.Contributing Back Upstream
When an HT-specific change is general enough to benefit the upstream project:
Create a branch from
main(notht):Cherry-pick or rewrite the relevant commits cleanly — no HT-specific references, no unrelated changes:
Open a PR against the upstream repo's
mainfollowing their contribution guidelinesOnce merged upstream, the change will flow back into our
mainon the next sync. Drop the corresponding commit fromhtduring the next rebase (it's now redundant).Annotate in the README: mark the change as upstreamed in the HT Fork Changes section:
Setting Up a New Fork
htbranch:htas default branch:All reactions