summaryrefslogtreecommitdiffstats
path: root/githooks.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-01-25 13:32:36 -0800
committerJunio C Hamano <gitster@pobox.com>2013-01-25 13:32:36 -0800
commit36d5229ff97f2456bb10db95a3793c682ced30ea (patch)
tree23c06322b81b84b6b0df21b00c08d81e90cca23a /githooks.txt
parente77c5d0bdc4c4f3ca9b8fc6f7147c3938be402a8 (diff)
downloadgit-htmldocs-36d5229ff97f2456bb10db95a3793c682ced30ea.tar.gz
Autogenerated HTML docs for v1.8.1.1-439-g50a6b
Diffstat (limited to 'githooks.txt')
-rw-r--r--githooks.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/githooks.txt b/githooks.txt
index b9003fed2..d839233df 100644
--- a/githooks.txt
+++ b/githooks.txt
@@ -176,6 +176,35 @@ save and restore any form of metadata associated with the working tree
(eg: permissions/ownership, ACLS, etc). See contrib/hooks/setgitperms.perl
for an example of how to do this.
+pre-push
+~~~~~~~~
+
+This hook is called by 'git push' and can be used to prevent a push from taking
+place. The hook is called with two parameters which provide the name and
+location of the destination remote, if a named remote is not being used both
+values will be the same.
+
+Information about what is to be pushed is provided on the hook's standard
+input with lines of the form:
+
+ <local ref> SP <local sha1> SP <remote ref> SP <remote sha1> LF
+
+For instance, if the command +git push origin master:foreign+ were run the
+hook would receive a line like the following:
+
+ refs/heads/master 67890 refs/heads/foreign 12345
+
+although the full, 40-character SHA1s would be supplied. If the foreign ref
+does not yet exist the `<remote SHA1>` will be 40 `0`. If a ref is to be
+deleted, the `<local ref>` will be supplied as `(delete)` and the `<local
+SHA1>` will be 40 `0`. If the local commit was specified by something other
+than a name which could be expanded (such as `HEAD~`, or a SHA1) it will be
+supplied as it was originally given.
+
+If this hook exits with a non-zero status, 'git push' will abort without
+pushing anything. Information about why the push is rejected may be sent
+to the user by writing to standard error.
+
[[pre-receive]]
pre-receive
~~~~~~~~~~~