Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/templates/hooks/pre-push.sample # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / templates / hooks / pre-push.sample` 53 lines ยท 1374 bytes Raw Blame History 1 #!/bin/sh 2 3 # An example hook script to verify what is about to be pushed. Called by "git 4 # push" after it has checked the remote status, but before anything has been 5 # pushed. If this script exits with a non-zero status nothing will be pushed. 6 # 7 # This hook is called with the following parameters: 8 # 9 # $1 -- Name of the remote to which the push is being done 10 # $2 -- URL to which the push is being done 11 # 12 # If pushing without using a named remote those arguments will be equal. 13 # 14 # Information about the commits which are being pushed is supplied as lines to 15 # the standard input in the form: 16 # 17 # 18 # 19 # This sample shows how to prevent push of commits where the log message starts 20 # with "WIP" (work in progress). 21 22 remote="$1" 23 url="$2" 24 25 zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" 48 exit 1 49 fi 50 fi 51 done 52 53 exit 0