It can also be used to refuse the commit after inspecting the message file.

endnotes not updating-64

See contrib/hooks/for an example of how to do this.

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.

In an environment that restricts the users' access only to git commands over the wire, this hook can be used to implement access control without relying on filesystem ownership and group membership.

See git-shell(1) for how you might use the login shell to restrict the user’s access to only git commands..

Such a push by default is refused if the working tree and the index of the remote repository has any difference from the currently checked out commit; when both the working tree and the index match the current commit, they are updated to match the newly pushed tip of the branch.

This hook is to be used to override the default behaviour.

may copy hooks to the new repository, depending on its configuration.

See the "TEMPLATE DIRECTORY" section in git-init(1) for details.

When the rest of this document refers to "default hooks" it’s talking about the default template shipped with Git.

The hook is allowed to edit the message file in place, and can be used to normalize the message into some project standard format.