On Friday, March 4, 2016 at 4:04:26 PM UTC-6, Mike Lewis wrote:
> Is there any hook that fires when a 
> git reset
> command is issued? The natural assumption would be the 
> post-rewrite
> hook, since part of the history is being rewritten, but it does not, both 
> according to the official documentation and some experiments that I've run. 
> The hook doesn't necessarily have to be a reset-specific hook, I just need 
> something that fires when a reset is performed.

Google finds a stack overflow post that seems to imply there is no such hook


One way if you can invoke a different command (other than 'reset') is to 
add an alias in .gitconfig that invokes a script and then calls git reset 
if that script returns a 0.
This assumes you have a PATH in which the script 'my_reset_hook_script.sh' 
can be found and passes extra arguments to 'git reset' through "$@" :

    myreset = "!f(){ my_reset_hook_script.sh && git reset \"$@\"; }; f"

Then you would just use "git myreset".


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to