STG-INIT(1)

πŸ’… stg-init β€” bestie edition ✨

okay so real talk, this is the stg-init page from the StGit manual, and we're gonna get you so caught up on it 🫢


🌸 NAME 🌸

stg-init β€” literally just initializes a StGit stack on a branch, no cap πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

stg init [OPTIONS]

that's it. that's the whole vibe. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, here's the tea: this command initializes a StGit stack on a branch πŸ’…

when you initialize a branch with a StGit stack, it commits initial, empty stack state for that branch to the repository. those stack metadata commits are tracked by the refs/stacks/<branch> reference, iykyk. every StGit command that modifies the stack commits updated stack state. and like β€” good news β€” if you're a StGit user, you never have to touch the refs/stacks/<branch> ref directly, bestie. it's giving main character energy but it handles itself πŸ’€

✨ fun fact: some StGit commands, like stg new and stg uncommit, will automatically initialize the stack for you. so it's often not even necessary to explicitly initialize the stack on a branch. also, branches created with stg branch --create are automatically initialized. slay. πŸ‘‘

but β€” and this is the important bit, bestie β€” the branch must already exist and point to a commit before you can initialize a StGit stack on it. no branch, no commit, no stack. periodt. πŸŽ€

also lowkey: StGit stack metadata can be deinitialized from a branch using stg branch --cleanup. see stg-branch(1) for the full rundown. πŸ’–


πŸ’… OPTIONS πŸ’…

  • -b <branch>, --branch=<branch> β€” use <branch> instead of the current branch, like, if you're feeling spicy and want to init somewhere else 🌈

🧚 STGIT 🧚

part of the StGit suite β€” go peek at stg(1) if you wanna see the whole fam πŸ’œ


and that's the whole page, bestie! ✨ this lil manual is from StGit 2.7.0, dated 10/17/2026 β€” so go forth and initialize those stacks, you iconic Unix queen πŸ‘‘πŸ’–

πŸ“¦ where this page comes from