stgit
what's the point?
The idea is to be able to keep a clean git history that allows for it to be git bisectable. Rather than co-mingling git commits, commits should contain one reasonable change.
stgit also allows for reordering commits before they are pushed. So, if you're building out some new feature, you could work out different parts of you code and move them around after the fact.
workflow
initialize a path
stg init
create a new patch
stg new <name of patch>
… make some changes
Add all changes
this seems to add every change to patch regardless on if it was staged or not.
stg refresh
show changes
stg show
stg show <some patch name>
navigating between patches
unapply a single patch
stg pop
reapply a single patch
stg push
navigate to a patch
this applies the necessary push/pop operations to get to the patch
stg goto <patch-name>
catch up with remote
unapply every patch
stg pop --all
# you can checkout where you are with standard commands
# e.g. `git status` `git log --oneline` `stg series`
pull down remote changes
git pull
reapply every patch
stg push --all
commit
stg commit --all
this tells stg that the commits have graduated to actual commits (they were actual commits before, but now stg will stop tracking them). I think the intent is for you to git push after this.
Reference
- Official documentation: https://stacked-git.github.io/guides/tutorial/
- `man stg` for local command reference