Git push, streaming message to client terminal

Let's say I have a git server. On every click I need to start a process and I can do it with a hook.

You need to write the stdout process to the git client that did the push. This is very similar to pushing Heroku or Openshift.

Question: how to send text streams / message back to the git client so that it can print it to the terminal?

+3


source to share


2 answers


The Git hook page mentions:

Both standard output and standard error output are sent at git send-pack

the other end, so you can just echo

post messages to the user.



Don't forget to add set -x

if you want to see all the commands executed by your script.

+3


source


While @ VonC's answer was perfect for me, I also came across a library that helps in this case.

Gitreceived is part of the Flynn project:



An SSH server built specifically to accept git pushes, which will run an auth script and then a receiver script to handle the push.

+3


source







All Articles