5

I have some local files that all developers have to change. I marked the files as "assume unchanged" but that doesn't keep them from changing when doing a reset. Is there a hook on git that's executed after git reset?

If not, does anybody have a suggestion on how to handle this situation?

4

2 回答 2

3

You can find a list of Git hooks here:

  • applypatch-msg
  • pre-applypatch
  • post-applypatch
  • pre-commit
  • prepare-commit-msg
  • commit-msg
  • post-commit
  • pre-rebase
  • post-checkout
  • post-merge
  • pre-receive
  • update
  • post-receive
  • post-update
  • pre-auto-gc
  • post-rewrite

There is no post-reset hook among them.

于 2013-09-05T20:50:57.027 回答
-3

如果有帮助,重置后似乎会触发结帐后。

该触发器的第三个参数可能会让你做你想做的事。

例如:

#!/bin/sh


if [ "$3" -eq "0" ]
then
    echo "$3 indicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0)"
fi
于 2017-03-07T21:01:16.597 回答