0

I added a new git pre-push hook, to avoid pushing a commit without a specific file, asking the user to approve pushing without that file:

echo -e "Are you sure you want to continue without the file [y/n]"
read -n1 -s decision

It works fine on bash and on MinGW, but when using TortoiseGit, it skips the 'read' action, and just continues. Is there any way to get interactive input from the user?

1 Answer 1

1

TortoiseGit does not fully support Git hooks.

Please use TortoiseGit hooks instead.

2
  • Yea, I saw that, but the hooks do run. I've also seen that I can write a specific script for Tortoise, but then I'll have to handle more than a single file for the same hook. Is there a way to get indication where the GIT is running from? i.e. running from mingw/command line or from tortoise?
    – LYB
    Commented Aug 25 at 11:54
  • TortoiseGit sets the environment variable TGIT_INITIATED_CALL when it executes git.exe
    – MrTux
    Commented Aug 25 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.