Skip to content

Instantly share code, notes, and snippets.

@goyalmohit
Created April 14, 2019 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goyalmohit/acffd2e69cb6f8892f67d59250559b9e to your computer and use it in GitHub Desktop.
Save goyalmohit/acffd2e69cb6f8892f67d59250559b9e to your computer and use it in GitHub Desktop.
pre-receive git hook in python script to print incoming refs
#!/usr/bin/env python
import sys
import fileinput
# Read in each ref that the user is trying to update
for line in fileinput.input():
print "pre-receive: Trying to push ref: %s" % line
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment