Git hook for any action that updates the working directory

时光总嘲笑我的痴心妄想 提交于 2019-12-01 00:19:50
VonC

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; currently git-filter-branch does 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-info is again command-dependent. If it is empty, the preceding SP is also omitted. Currently, no commands pass any extra-info.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!