Ivan Dokov
Ivan Dokov

Reputation: 4133

Git post-receive user input

I am trying to implement a database import after a git push origin master, but the problem is I cannot prompt the user for input from post-receive hook in Git. I need to ask the user about the import, if it should happen and for the name of the database export file.

I couldn't find any useful information in Google.

Upvotes: 3

Views: 538

Answers (1)

VonC
VonC

Reputation: 1324606

The hook itself can only return stdout/stderr, not wait for stdin.

One way would be to push the instructions with the data, for the hook to use.
Another would be to communicate those instructions separately on the server, with the hook knowing where to look.

In both cases, the idea is to get an automated process instead of an interactive one.

Upvotes: 3

Related Questions