With Git 2.10 a new option came [--push-option=]. When a bare repository is created a post-receive.sample is auto created inside hooks directory, which saying following:
#!/bin/sh
#
# An example hook script to make use of push options.
# The example simply echoes all push options that start with 'echoback='
# and rejects all pushes when the "reject" push option is used.
#
# To enable this hook, rename this file to "pre-receive".
I tried following steps
git push --push-option=echoback=Hello_world
As the sample says it put back the Hello_world
in my terminal.
Git Hook Manual says that i could send multiple options via --push-option=
which will be available via GIT_PUSH_OPTION_0, GIT_PUSH_OPTION_1,...
as the manual suggests.
My Question is How should i pass multiple options ? which could be passed via --push-option=
Tried options:
git push --push-option="echoback=Hello echoback=World"
git push --push-option="echoback=Hello;echoback=World"
git push --push-option="echoback=Hello&echoback=World"
git push --push-option="echoback=Hello%echoback=World"
git push --push-option="echoback=Hello,echoback=World"
Try the following:
git push --push-option="echoback=Hello" --push-option="echoback=World"
This seperates the --push-option
s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With