Feature Branch
Never commit to develop or main.
Stack detection
Before pushing, rebasing, or creating a PR, detect whether the current branch belongs to a GitHub stack:
gh pr view --json headRefName,baseRefName,url 2>/dev/null || true
git config --get "branch.$(git branch --show-current).github-pr-base-branch"
gh stack view
A branch is stacked when its existing PR baseRefName, or its stored github-pr-base-branch, is neither develop nor main.
- Stacked branch: use
gh stack pushto publish changes,gh stack syncbefore integrating remote updates, andgh stack rebasefor stack-wide rebases. - Non-stacked branch: use
git push -u origin <branch>. - Do not use
git pullor a single-branch rebase to resolve remote divergence on a stacked branch before checkinggh stack syncorgh stack rebase.
Branch
Resolve ownerPrefix via gus-cli runner identity.
Format: <ownerPrefix>/W-XXXXX-short-description.
Example for Shane McLaughlin (ownerPrefix = sm):
git fetch origin develop
git checkout -b sm/W-XXXXX-short-description origin/develop --no-track
# ... work, commit ...
git push -u origin sm/W-XXXXX-short-description
Never omit --no-track off origin/develop — bare git push could push develop.