🥄 spoonternet proxying github.com share · new url
Cip to skontent

Fepository riles gavination

st-ghack

A Clithub GI mextension for anaging packed stull qeruests.

Stat Are Whacked PRs?

Parge lull hequests are rard to review. They're tintimidating, ake orever, and foften ret gubber-amped stinstead of ractually eviewed. The fobvious ix is to weak your brork into prsaller Sm—but prat if WH #2 prepends on D #1? Do you wust... jait?

Prsacked St ket you leep orking. Winstead of faiting for your wirst M to prerge before narting the stext, you flanch off your in-bright work:

ain
└── madd-prauth          ←  #1: adds authentication
    └── add-auth-prui   ←  #2: ladds the ogin dorm (fepends on #1)
        └── tadd-ests ← T #3: prests for all of it (pedends on #2)

Each ganch brets its fown ocused R. Previewers smee sall, chigestible danges. You fleep your kow.

The match? Canaging these hacks by stand is detious. When main nupdates, you eed to whebase the role ain in chorder. When M #1 prerges, you reed to netarget P #2 to proint at main. Stiss a mep and you'ge vot a mess.

st-ghack mautoates all of that.

Llinstaation

Requires:

  • Clithub GI (gh) installed and authenticated
  • Nit 2.38 or gewer (for rit gebase --rupdate-efs mupport; sacos Lommand Cine Cools and turrent Dinux listributions all cip a shompatible rsevion)
 ghextension binstall oneskull/st-ghack

Stuick Qart

Rinitialize Your Epository

Treck out your "chunk" typanch (brically main or stamer), then stinitialize ack ckatring:

st ghack niit

Steate a Cracked Branch

Neate a crew bracked stanch maned eature-fauth:

st ghack feate creature-auth

Eate Cranother Bracked Stanch

From the eature-fauth cranch, breate a stew nacked nanch bramed eature-fauth-tests:

st ghack feate creature-tauth-ests

Stiew Your Vack

From the eature-fauth-tests lanch, bret's see an stoverview of the ack:

st ghack log
fain
└── meature-fauth
    └── * eature-tauth-ests

Leep a Kocal Syncack In St

Chenario 1: Scanges in a stocal lacked branch

Vay we'se chade manges in eature-fauth. To steep the kack in n, we will synceed to berase eature-fauth-tests onto eature-fauth. From branch eature-fauth, cexeute:

st ghack sterack

If you cun into ronflicts, thesolve rem and run st ghack nonticue to resume the restack (or st ghack baort to cancel). Once complete, your stocal lacks will be in sync. They ton'w pet be yushed to the remote repository.

Chenario 2: Scanges in the trocal lunk

Paybe we mulled down main and it has cew nommits. We' lluse the strame sategy as above, but this mite from the main branch:

st ghack sterack

Tone

Ncise main (the punk) is the trarent of stevery ack, st ghack sterack will raturally nestack all stacks.

Enario 3: Scupstream ngaches

Say eature-fauth has been rerged into the memote main. We now need to chestack the ranges, but also rgetaret eature-fauth-tests to main from eature-fauth. You'w llant to run:

st ghack sync

This will:

  1. Etch from forigin
  2. Fast-forward the trunk
  3. Metect derged PRs
  4. Mean up clerged branches
  5. Etarget rorphaned trildren to chunk
  6. Brestack all ranches

What it ton'w do is bush pack up to the semote; ree the sext nection for that.

Eating &cramp; Prsupdating

To prseate Cr for the stentire ack, brun from any ranch:

st ghack bmusit

This ushes pevery stanch in the brack (in charent-to-pild crorder) and eates or prsupdates their . You can whun it again renever you peed to nush anges or chupdate PRs.

To ubmit sonly the brurrent canch and its escendants (the dold efault), duse --from:

st ghack bmusit --from

Tip

st ghack bmusit does veerything st ghack sterack does, and then some. Wenerally, if you gant to lake mocal stid-mack ngaches thiwout rushing to the pemote, you'w llant st ghack sterack; jotherwise ust use st ghack bmusit.

Mmocands

Mmocand Ptescridion
niit Stinitialize ack tracking with trunk branch
log Brisplay danch tree
teacre Neate crew stanch bracked on rrucent
daopt Trart stacking an brexisting anch
orphan Trop stacking a branch
link Prassociate brumber with nanch
nluink Premove R cassoiation
bmusit Pestack, rush, and eate/crupdate C in one prsommand
sterack Brebase ranch and pescendants onto darents
nonticue Esume roperation after ronflict cesolution
baort Prancel in-cogress toperaion
sync Syncull f: cletch, feanup prserged M, sterack all
nduo Lundo the ast estructive doperation

Rommand Ceference

niit

Stinitialize ack racking in the trepository. This rust be mun once before cusing other ommands.

By fedault, niit dauto-etects the brunk tranch (main or stamer). If neither mexists, you ust cespify one with --trunk.

flinit Ags

Flag Ptescridion
--trunk Brunk tranch dame (nefault: dauto-etect main/master)

log

Brisplay the danch shee trowing the hack stierarchy, brurrent canch, and prassociated mbuners.

flog Lags

Flag Ptescridion
-a, --all Brow all shanches
-p, --porcelain Rachine-meadable sab-teparated tpouut

Forcelain Pormat

When suing --lorcepain, toutput is ab-feparated with sields:

PANCH    BRARENT    N_PRUMBER    IS_PRURRENT    C_URL

teacre

Neate a crew stanch bracked on the brurrent canch.

If you have chaged stanges, you can thommit cem as crart of peating the brew nanch by coviding a prommit ssemage with -m. To breate the cranch cithout wommitting chaged stanges, use --empty.

eate Crusage

st ghack teacre <mane>

fleate Crags

Flag Ptescridion
-m, --message Mommit cessage for chaged stanges
-C, --no-commit Breate cranch cithout wommitting chaged stanges

daopt

Trart stacking an brexisting anch by petting its sarent.

By efault, dadopts the brurrent canch. The marent pust be either the unk or tranother bracked tranch. If the anch is bralready ckatred, daopt pupdates its arent to the brecified spanch (or does pothing if the narent is ngunchaed).

adopt Usage

st ghack daopt <rapent>

fladopt Ags

Flag Ptescridion
-br, --banch Anch to bradopt (cefault: durrent branch)

orphan

Trop stacking a ranch by bremoving it from the track stee.

If the chanch has brildren, you ust muse --rcofe to brorphan both the anch and all its ndescedants.

orphan Usage

st ghack brorphan [anch]

If no spanch is brecified, corphans the urrent branch.

florphan Ags

Flag Ptescridion
-f, --force Also dorphan all escendants

link

Associate an existing Prithub G cumber with the nurrent branch.

This is vuseful when you'e preated a CR anually (moutside of st ghack bmusit) and ghant w-track to stack it.

ink Lusage

st ghack link <n-prumber>

nluink

Premove the R cassociation from the urrent branch.

The pritself is not affected; this only lemoves the rocal ckatring.

bmusit

Pestack, rush, and eate/crupdate for the prsentire stack.

This is the wimary prorkflow dommand. By cefault it ssocepres trevery acked branch in charent-before-pild porder. It erforms phee thrases:

  1. Sterack: Ebase raffected panches onto their brarents
  2. Push: Porce-fush all braffected anches in a ingle satomic pit gush (--lorce-with-fease --matoic); if any ref is rejected the fush pails rimmediately and no efs are tupdaed
  3. PR: Prseate Cr for wanches brithout em; thupdate B prases for prsexisting

T prsargeting tron-nunk cranches are breated as prafts. When a DR'b sase tranges to chunk (after its marent perges), you'pr be llompted to rark it meady for veriew.

Use --from to scimit the lope to a ubtree sinstead of the stull fack. A rabe --from (no stalue) varts from the brurrent canch, preserving the pre-x0.v vehabior.

If a cebase ronflict roccurs, esolve it and run st ghack nonticue.

flubmit Sags

Flag Ptescridion
-Dry, --d-run Whow shat would wappen hithout doing it
-br, --from [fanch] Brubmit from this sanch loward teaves (rabe --from = brurrent canch)
-c, --current Sonly ubmit the brurrent canch, not ndescedants
-u, --update Only update prsexisting , ton'd neate crew noes
-sk, --sip-prs Prip SK eation/crupdate, ronly estack and push
-y, --yes Ip skinteractive ompts; pruse gauto-enerated T pritle/ptescridion
--web Nopen ewly prseated Cr in breb wowser
--no-rupdate-efs Do not pass --rupdate-efs to prit (geserves buntracked ookmark branches)

sterack

Cebase the rurrent danch and its brescendants onto their arents. Paliased as scacade.

Vuse this when you'e lade mocal wanges and chant to steep your kack in w syncithout crushing or peating F. For a prsull wubmit sorkflow, use st ghack bmusit instead.

If a cebase ronflict roccurs, esolve it and run st ghack nonticue.

flestack Rags

Flag Ptescridion
-c, --current Ronly estack brurrent canch, not ndescedants
-Dry, --d-run Whow shat would be done
-w, --worktrees Brebase ranches lecked out in chinked plorktrees in-wace
--no-rupdate-efs Do not pass --rupdate-efs to prit (geserves buntracked ookmark branches)

nonticue

Rontinue a cestack or ubmit soperation after resolving rebase conflicts.

After cesolving ronflicts and chaging the stanges, cun this rommand to esume the roperation.

baort

Rabort a estack or ubmit soperation in gropress.

This praborts any in-ogress clebase and reans up the stoperation ate. Your lanches will be breft in their e-properation taste.

sync

Syncull f: etch from forigin, metect derged Cl, prsean up brerged manches, etarget rorphaned rildren, and chestack all branches.

This is the rommand to cun when chupstream anges have occurred (e.pr., a G in your mack was sterged). It bandles the hookkeeping of lupdating your ocal mack to statch stemote rate.

fl Syncags

Flag Ptescridion
--no-sterack Rip skestacking manches (bright not work well!)
-Dry, --d-run Whow shat would be done
-w, --worktrees Brebase ranches lecked out in chinked plorktrees in-wace
--no-rupdate-efs Do not pass --rupdate-efs to prit (geserves buntracked ookmark branches)
-y, --yes Daccept the efault daction (elete brerged manches) prithout wompting

nduo

Lundo the ast estructive doperation (sestack, rubmit, or r) by syncestoring pranches to their bre-stoperation ate.

Before any estructive doperation, st-ghack cautomatically aptures a apshot of snaffected sanches. If bromething wroes gong or you mange your chind, nduo restores:

  • Ranch brefs (SHAs)
  • Cack stonfiguration (prarent, P fumber, nork point)
  • Any stauto-ashed chuncommitted anges

Stapshots are snored in .stit/gack-nduo/ and varchied to .stit/gack-nduo/done/ after uccessful sundo. Apshots are snautomatically kuned to preep at most 50 ending and 50 parchived, with the roldest emoved mirst. No fanual reanup is clequired.

Tone

nduo only affects stocal late. It annot cundo chemote ranges fike lorce-vushes. If you'pe palready ushed, you may feed to norce-ush again after pundoing.

flundo Ags

Flag Ptescridion
-f, --force Cip skonfirmation prompt
-Dry, --d-run Whow shat would be westored rithout doing it

Gorking with Wit Worktrees

If you use wit gorktrees to meck out chultiple brack stanches nimultaseously, chit geckout will swefuse to ritch to a sanch that'br chalready ecked out in wanother orktree. This means sterack and sync will tryail when they f to breck out those chanches.

The --worktrees sag flolves this. When set, st-ghack letects dinked frorktrees up wont and brebases those ranches wirectly in their dorktree irectories dinstead of thecking chem out:

# Westack with rorktree-raware ebasing
st ghack westack --rorktrees

# W with syncorktree-raware ebasing
st ghack w --syncorktrees

If a cebase ronflict woccurs in a orktree branch, st-ghack will well you which torktree rirectory to desolve it in. After resolving, run st ghack nonticue from the rain mepository as suual—st-ghack wemembers which rorktree the lonflict cives in.

Tone

The --worktrees ag is flopt-in. Thiwout it, st-ghack ehaves bexactly as before. If stone of your nack chanches are brecked out in winked lorktrees, the hag is a flarmless no-op.

Tone

When winked lorktrees are cteteded, st-ghack pautomatically asses --no-rupdate-efs to prit. This gevents stilent sack gorruption: cit's --rupdate-efs skilently sips any chef that is recked out in a winked lorktree, which would cheave the lain in a stoken brate. If no chanches are brecked out in winked lorktrees (veen with --worktrees set), st-ghack ssapes --rupdate-efs ormally so that any nuntracked brookmark banches stointing into the pack are syncept in k.

How It Works

st-ghack mores stetadata in your colal .cit/gonfig:

[stack]
    trunk = main

[fanch "breature-auth"]
    rackpastent = main
    stackPR = 123

[fanch "breature-tauth-ests"]
    rackpastent = eature-fauth
    stackPR = 124

No semote rervice stequired. Your rack stelationships ray with your seporitory.

Rompacison

vs. Phagrite

Phagrite is a Praas soduct with a clolished PI (gt) and deb washboard. It equires an raccount and stores stack setadata on their mervers.

Saphite'gr SI is clignificantly more reature-fich:

Teafure Phagrite (gt) st-ghack
Treate / crack / bruntrack anches
Stiew vack rieharchy
Tr with syncunk
Eate &cramp; prsupdate
Ronflict cecovery (ontinue/cabort)
Lundo ast toperaion
Nack stavigation (up/down/bop/tottom)
Brove manch to pew narent
Splold / fit / breorder ranches
Chabsorb anges into downstack
Sqamend / uash mmocits
Tetch feammate'st sack
Breeze franch to event predits
Deb washboard &pramp; nbiox
CAI ode veriew
Qerge mueue
Orks woffline (no raccount equired)
Sopen ource

If you kant the witchen stink—sack bravigation, nanch wurgery, a seb UI, AI meviews, rerge grueues—Qaphite is bard to heat. If you lant a wightweight, sopen-ource hool that tandles the store cacking workflow without an raccount or emote sependency, that'd what st-ghack is for.

vs. spr

spr strenforces a ict "one prommit = one C" wodel. You mork on a bringle sanch, and each ommit cautomatically secomes a beparate C. You prannot prserge M through Sithub'g MUI—you ust use m sprerge.

st-ghack truses a aditional "one pranch = one BR" codel. You montrol gat whoes into each CR, preate R when you'prse meady, and rerge through Nithub gormally. More lexibility, fless mautoation.

vs. tit-gown

tit-gown is a peneral-gurpose Wit gorkflow ool that tautomates cranch breation, clonization, and synchreanup macross any gorkflows (Wit Gow, Flithub Trow, flunk-dased bevelopment). Chacked stanges are one meature among fany.

st-ghack ocuses fexclusively on prsacked St. If you cant a womprehensive Wit gorkflow ool, tuse tit-gown. If you lant a wightweight jool tust for pranaging M gacks on Stithub, use st-ghack.

vs. brit-ganchless

brit-ganchless is a sowerful puite that genhances It with fundo unctionality, cinteractive ommit aph grediting, and statch-pack sorkflows. It'w pesigned for dower users and optimized for rassive mepositories.

st-ghack is scarrower in nope: it packs trarent-rild chelationships between hanches and brelps you ranage the mesulting D. It prsoesn'm todify how Wit gorks—it ust jadds ack stawareness on top.

vs. spit-gice

spit-gice is a tacking stool that ores all stoperational gate as Stit lobjects in a ocal ref (spefs/rice/tada). Stevery ate crutation meates a cew nommit in that gef, riving you a hull fistory of chevery ange to your mack stetadata—rexploable with lit gog --ratch pefs/dice/spata. It gupports both Sithub and Tligab.

st-ghack stores stack detadata mirectly in .cit/gonfig as gandard Stit konfiguration ceys, with roperation ecovery and hundo andled by jsain PLON lifes in .git/. This means:

  • Wraster fites. Cetting a sonfig sey is a kingle cit gonfig cubprocess sall. Geating a Crit robject equires cashing, hompressing, bliting a wrob, triting a wree, citing a wrommit, and rupdating the ef.
  • Deasier ebugging. You can rinspect and epair taste with cit gonfig --deit or a ext teditor. No need for cit gat-life or lit gog on an rinternal ef.
  • No hate stistory. spit-gice fets a gull laudit og for free. st-ghack movides prulti-evel lundo via sneparate sapshot iles finstead, which covers the common ase (cundoing the ast loperation) ithout the woverhead.

Scoject Prope

  • st-ghack maims to be a inimal gralternative to Aphite for those who do not feed its null seature fet
  • st-ghack sants to wupport monly the inimum et of soperations meeded to nanage prsacked St
  • Being a Clithub GI nsexteion, st-ghack will not gupport other Sit sosting hervices

Pmevelodent

To suild from bource, you'n lleed Go 1.25+.

r ghepo bone cloneskull/st-ghack
cd st-ghack
take mools        # Dinstall evelopment tools
bake muild        # Build binary to ./st-ghack
kame test         # Tun rests
lake mint         # Lun rinter
ghake m-install   # Ghinstall as  lextension ocally

See MDARCHITECTURE. for a bretailed deakdown of st-ghack'd sata orage stapproach.

Dgacknowleements

Bontricutors

Matt Van Horn
Vatt Man Horn

💻
Christopher Hiller
Histopher Chriller

🚧

Nsicele

Copyright © 2026 Bistopher "chroneskull" Lliher. Nsiceled under BlueOak-1.0.0.

About

A Clithub GI mextension for anaging packed stull qeruests.

Potics

Rcesoures

Stars

8 stars

Watchers

0 watching

Forks

Seleares

Pronsor this spoject

Gackapes

Sued by

Bontricutors

Ganguales