Change --push-option with Hooks

Asked

Viewed 28 times

0

You can change the --push-option message with a local hook when pushing?

Example: When rotating the command git push origin master, the pre-push hook would inject the "test" value into the --push-option, changing the command to git push origin master --push-option "teste"

The goal of this is that I need to do some local validations before I push, so at the time of sending to the server, I would inject the push-options a single token that can be validated on the server side to ensure that these validations have been made.

1 answer

0

To load a token into the push-option an option would be within your .gitconfig perform the following configuration:

inserir a descrição da imagem aqui

You can use that as a reference, this way the token will be dynamically loaded into the push-option

Browser other questions tagged

You are not signed in. Login or sign up in order to post.