Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to get information in post-receive git hook #1808

Closed
UziTech opened this issue May 25, 2017 · 3 comments · May be fixed by DevVault/gitea#5
Closed

[Question] How to get information in post-receive git hook #1808

UziTech opened this issue May 25, 2017 · 3 comments · May be fixed by DevVault/gitea#5
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@UziTech
Copy link

UziTech commented May 25, 2017

How can I get the information provided to stdin in the git post-receive hook?

I've tried

read var
echo $var

and it returns nothing

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label May 25, 2017
@bkcsoft
Copy link
Member

bkcsoft commented Jun 8, 2017

post-receive hook doesn't get anything from stdin. See git documentation on how to use it: https://git-scm.com/docs/githooks

@UziTech
Copy link
Author

UziTech commented Jun 8, 2017

post-receive

This hook is invoked by git-receive-pack on the remote repository, which happens when a git push is done on a local repository. It executes on the remote repository once after all the refs have been updated.

This hook executes once for the receive operation. It takes no arguments, but gets the same information as the pre-receive hook does on its standard input.

@UziTech
Copy link
Author

UziTech commented Jun 8, 2017

pre-receive

This hook executes once for the receive operation. It takes no arguments, but for each ref to be updated it receives on standard input a line of the format:

<old-value> SP <new-value> SP <ref-name> LF

@UziTech UziTech closed this as completed Aug 24, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants