Is there a hook on git for post-reset?

I have local files that all developers must modify. I marked the files as "assumed to be unchanged," but that does not stop them from changing when resetting. Is there a hook on git that executes after git reset?

If not, does anyone have a suggestion on how to deal with this situation?

+4
source share
2 answers

Here you can find the list of Git hooks here :

  • applypatch message
  • pre applypatch
  • after applypatch
  • before fixing
  • prepare commit messages
  • commit-message
  • after fixation
  • relocate
  • post control
  • after the merger
  • pre get
  • update
  • after taking
  • after update
  • pre auto ds
  • after rewriting

There is no post-reset between them.

+2
source

In case this helps, the post-check seems to fire after reset.

The third parameter of this trigger is likely to let you do what you want.

eg:.

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

Source: https://habr.com/ru/post/1500808/


All Articles