If I git stash -k
(stash all unstaged changes) and git pop
, I get merge conflicts if one of the files was modified in the staging area and also had an unstaged change.
I'm writing a script that calls git stash -k
, lints the files, and commits them if they pass. If not, I'd like to git stash pop
and return the working tree to precisely its previous state.
Is this possible? Is there a merge-conflict-free way of achieving this?
Thank you!