Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do git hooks provide arguments on different operating systems

Tags:

git

I was reading this article on Git Hooks: https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks

For some of the hooks like pre-push, they supply arguments via stdin, such as the local ref. So for example, the pre-push script will supply the local ref as an input like refs/heads/<my branch name>.

Will these be supplied differently on Windows OS for example? E.g., refs\heads\<my branch name>, or will they always be supplied as forward slashes, similar to git commands.

It wasn't clear in the documentation and I don't have a windows machine so I can't check.

like image 892
Ogen Avatar asked Mar 27 '26 13:03

Ogen


1 Answers

The references (and hash IDs) supplied on the standard input for such hooks are in the same forward-slash format as on Linux systems—these are Git strings, not file names.

like image 186
torek Avatar answered Mar 30 '26 09:03

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!