| Crates.io | git-workflow |
| lib.rs | git-workflow |
| version | 0.1.3 |
| created_at | 2026-01-25 23:39:09.57758+00 |
| updated_at | 2026-01-26 01:50:18.645013+00 |
| description | Git workflow CLI - type-safe worktree-aware git operations with GitHub integration |
| homepage | https://github.com/lanegrid/git-workflow |
| repository | https://github.com/lanegrid/git-workflow |
| max_upload_size | |
| id | 2069820 |
| size | 161,296 |
A type-safe Git workflow CLI with worktree support and GitHub integration.
cargo install git-workflow
git clone https://github.com/zawakin/git-workflow.git
cd git-workflow
cargo install --path .
$ gw status
ℹ Branch: main (home)
→ Next: start new work
$ gw new fix/typo
✓ Created fix/typo from origin/main
# ... make changes, commit ...
$ gw status
ℹ Branch: fix/typo (home: main)
! Unpushed: 1 commit
→ Next: push and create PR
# ... push, create PR, get merged ...
$ gw cleanup
✓ PR #42 [MERGED]
✓ Deleted fix/typo
✓ Back to main
The CLI is invoked using the gw command.
gw homeSwitch to home branch and sync with origin/main (or origin/master).
gw home
# Main repo → switches to 'main'
# Worktree → switches to home branch
gw new <branch>Create a new branch from origin/main.
gw new feature/add-login
gw new fix/memory-leak
gw statusShow current repository state including:
gw status
# ℹ Repository: worktree (home: feature-x)
# ✓ Branch: feature-x (home)
# ✓ Working directory: clean
# → Next: start new work
gw cleanup [branch]Delete a merged branch and return to home. Uses GitHub CLI to verify PR merge status.
gw cleanup # cleanup current branch
gw cleanup feature/old # cleanup specific branch
gw pause [message]Create a WIP commit with all changes and return to home branch.
gw pause
gw pause "waiting for API review"
gw abandonDiscard all changes and return to home branch.
gw abandon
gw undoUndo the last commit (soft reset to HEAD~1).
gw undo
gw syncAfter a base PR is merged, update the base to main and rebase.
gw sync
-v, --verbose - Show git commands being executedgw -v status
gw --verbose cleanup
cleanup and sync commands# Start new feature
gw new feature/user-auth
# ... work on feature ...
# Need to switch context? Pause work
gw pause "blocked on API changes"
# Switch to another task
gw new fix/urgent-bug
# ... fix the bug ...
# Clean up after PR is merged
gw cleanup
# Resume previous work
git checkout feature/user-auth
# Check status anytime
gw status
gw is designed to work seamlessly with git worktrees, enabling parallel development on multiple features.
Each worktree has its own "home branch":
main (or master)# Create a worktree
git worktree add ../feature-a feature-a
cd ../feature-a
gw status # Home: feature-a
# Work on feature-a in one worktree
cd ~/projects/feature-a
gw pause "WIP: need input"
# Work on feature-b in another worktree
cd ~/projects/feature-b
gw status # Home: feature-b
# Resume feature-a
cd ~/projects/feature-a
gw undo # Undo WIP commit
Licensed under either of:
at your option.
Contributions are welcome! Please feel free to submit a Pull Request.