Following an answer to a previous question, I implemented a Git hook script which needs to fire whenever the working directory is updated. I linked this script to the follo
Not sure about git stash pop (I offer some alternative in "Is there a way with to prevent “git stash pop” from marking files as modified?").
git update-index comes with another option --skip-worktree, which might avoid the git stash issue.
See "Git - Difference Between 'assume-unchanged' and 'skip-worktree'"
But for git rebase, you could be interested in the post-rewrite hook:
This hook is invoked by commands that rewrite commits (
git commit --amend,git-rebase; currentlygit-filter-branchdoes not call it!).
Its first argument denotes the command it was invoked by: currently one of amend or rebase. Further command-dependent arguments may be passed in the future.The hook receives a list of the rewritten commits on stdin, in the format
<old-sha1> SP <new-sha1> [ SP <extra-info> ] LF
The
extra-infois again command-dependent. If it is empty, the preceding SP is also omitted. Currently, no commands pass any extra-info.