6

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?

jcvalverde
  • 178
  • 2
  • 6

2 Answers2

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.

-3

In case it help, post-checkout seems to be triggered after a reset.

The 3rd param of that trigger would probably allow you to do what you want.

E.g.:

#!/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