Skip to content

Commit 683f0d6

Browse files
committed
docs: add authentication section and initial changelog
1 parent b7e4e15 commit 683f0d6

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
## [0.2.0] - 2026-07-06
6+
7+
First tagged release.
8+
9+
### Added
10+
- Stacked-branch management: view your stack tree (`git stack` / `status`), create stacked
11+
branches (`checkout`), restack onto parents (`restack`, with `-a`/`-f`/`-p` for recursive
12+
ancestor restacking, fetch, and push), diff against parent (`diff`), re-parent a branch
13+
(`mount`), and delete branches (`delete`).
14+
- Interactive TUI status mode with up/down navigation and a current-HEAD indicator.
15+
- GitHub integration: `sync` (push/pull local state, auto-prune merged or duplicate branches,
16+
retarget PR bases on mount) and `pr create` (opens PRs with the correct base branch).
17+
- GitHub authentication via `git stack auth login` (OAuth device flow or `--pat` paste),
18+
`auth status`, and `auth logout`.
19+
- Token resolution from `GITHUB_TOKEN`, `GH_TOKEN`, `git config github.token`, or the config
20+
file at `~/.config/git-stack/github.yaml`.
21+
- Last-resort auth fallback: borrows the `gh` CLI's token (via `gh auth token`) when no other
22+
source resolves, so users already logged in with `gh` need no separate setup.
23+
- Shell completions.
24+
25+
### Security
26+
- Config and state files are written with `0600` permissions.

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ git stack delete <branch> # remove a branch from the stack
7676
Note that `git stack sync` will automatically prune local branches that are duplicates of the remote
7777
branch, or have already been merged.
7878

79+
## Authentication
80+
81+
Commands that talk to GitHub (`sync`, `pr create`) need a token. Set one up with:
82+
83+
```bash
84+
git stack auth login # interactive OAuth device flow (recommended)
85+
git stack auth login --pat # paste a personal access token instead
86+
git stack auth status # show the active auth method
87+
git stack auth logout # clear git-stack's stored tokens
88+
```
89+
90+
git-stack resolves a token from the first source that provides one, in order:
91+
92+
1. `GITHUB_TOKEN` environment variable
93+
2. `GH_TOKEN` environment variable
94+
3. `git config --get github.token`
95+
4. Config file (`~/.config/git-stack/github.yaml`): host-specific token, then PAT, then OAuth token
96+
5. The [`gh` CLI](https://cli.github.com/): if none of the above resolve and you've run `gh auth
97+
login`, git-stack borrows `gh`'s token automatically (via `gh auth token`). Use `gh auth logout`
98+
to sign out of `gh`.
99+
79100
## Workflow Example
80101

81102
```bash

0 commit comments

Comments
 (0)