Patch Sets

Patch Sets let you maintain an ordered stack of diffs on top of any repository's branch. Sync an upstream repo, layer your customizations as discrete patches, and keep everything up to date when upstream moves forward. Think of it as a rebase-friendly fork that tracks exactly what you changed and why.

Quick Start

Five steps to your first patch set:

Step 1 — Sync a repo

Import an upstream repository so GitForge has the objects to work with.

gitforge sync https://github.com/user/repo
Step 2 — Create a patch set

A patch set is anchored to a base branch. All patches are applied on top of that ref.

gitforge patch create "my-changes" --repo <id> --base main
Step 3 — Clone and edit

The patch set creates a materialized branch (patches/my-changes). Clone it and make your changes.

git clone <repo-url>
git checkout patches/my-changes
# make your edits...
Step 4 — Push commits

Push commits to the materialized branch. Each commit becomes a patch in the set when you extract them.

git add -A && git commit -m "harden SSH defaults"
git push origin patches/my-changes

# Extract pushed commits as patch records:
gitforge patch push --set <id>
Step 5 — Rebase on upstream updates

When the upstream branch moves forward, rebase your patch set to re-apply your patches on top of the new base.

gitforge patch rebase --set <id>

API Reference

All endpoints require authentication via Bearer token or PAT.

POST
/patch-sets

Create a new patch set

GET
/patch-sets?repoId=<id>

List patch sets for a repo

GET
/patch-sets/:id

Get a patch set with its patches

PATCH
/patch-sets/:id

Update name, description, auto-rebase, or visibility

DELETE
/patch-sets/:id

Delete a patch set

POST
/patch-sets/:id/patches

Add a patch (diff) to the set

POST
/patch-sets/:id/extract-from-commits

Extract pushed commits as patches

POST
/patch-sets/:id/materialize

Rebuild the materialized branch

POST
/patch-sets/:id/rebase

Rebase patches onto updated base

POST
/patch-sets/:id/publish

Make the patch set public

DELETE
/patch-sets/:id/publish

Unpublish (make private)

POST
/patch-sets/:id/fork

Fork a public patch set

POST
/patch-sets/:id/subscribe

Subscribe to upstream updates

DELETE
/patch-sets/:id/subscribe

Unsubscribe

GET
/patch-sets/:id/updates

Check for upstream changes

POST
/patch-sets/:id/updates/accept

Accept upstream updates

Sharing Patch Sets

Patch sets can be published for others to discover, fork, and subscribe to.

Publish

Publishing a patch set makes it visible on the /explore/patch-sets page and gives it a stable URL at /patches/:owner/:setName.

gitforge patch publish --set <id>
Fork

Forking copies a public patch set into your account. You can modify it independently while optionally subscribing to upstream changes.

gitforge patch fork <setId> --name my-fork
Subscribe

Subscribing to a forked patch set lets you receive notifications when the original author adds, modifies, or removes patches.

gitforge patch subscribe --set <id>
gitforge patch updates --set <id>
gitforge patch accept --set <id> --all
Auto-Rebase

Enable auto-rebase on a patch set and GitForge will automatically re-apply your patches whenever the base branch receives new commits. If a conflict is detected, the patch set status changes to conflict and the conflicting patch is flagged so you can fix it manually.

# Enable auto-rebase via CLI
gitforge patch update --set <id> --auto-rebase

# Or via API
curl -X PATCH /patch-sets/<id> \
  -H "Authorization: Bearer <token>" \
  -d '{"autoRebase": true}'
See Also
Patch Sets — Customize Any Repo | GitForge