Using the rust branch, I run into this a lot:
stg pop --spillto incorporate some changes into a previous patchgit resetto unstage everythingstg refreshto update the patch after adding some updated filesstg pushto return to the next patch in the series
This invariably fails with:
error: Index/worktree dirty
And that's because the stg pop --spill + git reset means that any files in the subsequent patch that aren't included in the current patch are now in the way. Using git checkout, we would see something like this:
error: The following untracked working tree files would be overwritten by checkout:
cluster-scope/base/core/namespaces/external-secrets-operator/namespace.yaml
Please move or remove them before you switch branches.
Aborting
The solution here is generally git checkout --force, which will replace the indicated files.
It would be great if stg push had the same option, because sometimes cleaning this up is a pain (it would also be nice if stg push were to provide a list of files that are causing the error).