Home Explore Blog CI



git

3rd chunk of `Documentation/config/receive.adoc`
be0b41143e69796bf4eb527e0d99a78816b7ee027b44b2700000000100000c0c
 via a push.

receive.denyDeleteCurrent::
	If set to true, git-receive-pack will deny a ref update that
	deletes the currently checked out branch of a non-bare repository.

receive.denyCurrentBranch::
	If set to true or "refuse", git-receive-pack will deny a ref update
	to the currently checked out branch of a non-bare repository.
	Such a push is potentially dangerous because it brings the HEAD
	out of sync with the index and working tree. If set to "warn",
	print a warning of such a push to stderr, but allow the push to
	proceed. If set to false or "ignore", allow such pushes with no
	message. Defaults to "refuse".
+
Another option is "updateInstead" which will update the working
tree if pushing into the current branch.  This option is
intended for synchronizing working directories when one side is not easily
accessible via interactive ssh (e.g. a live web site, hence the requirement
that the working directory be clean). This mode also comes in handy when
developing inside a VM to test and fix code on different Operating Systems.
+
By default, "updateInstead" will refuse the push if the working tree or
the index have any difference from the HEAD, but the `push-to-checkout`
hook can be used to customize this.  See linkgit:githooks[5].

receive.denyNonFastForwards::
	If set to true, git-receive-pack will deny a ref update which is
	not a fast-forward. Use this to prevent such an update via a push,
	even if that push is forced. This configuration variable is
	set when initializing a shared repository.

receive.hideRefs::
	This variable is the same as `transfer.hideRefs`, but applies
	only to `receive-pack` (and so affects pushes, but not fetches).
	An attempt to update or delete a hidden ref by `git push` is
	rejected.

receive.procReceiveRefs::
	This is a multi-valued variable that defines reference prefixes
	to match the commands in `receive-pack`.  Commands matching the
	prefixes will be executed by an external hook "proc-receive",
	instead of the internal `execute_commands` function.  If this
	variable is not defined, the "proc-receive" hook will never be
	used, and all commands will be executed by the internal
	`execute_commands` function.
+
For example, if this variable is set to "refs/for", pushing to reference
such as "refs/for/master" will not create or update a reference named
"refs/for/master", but may create or update a pull request directly by
running the hook "proc-receive".
+
Optional modifiers can be provided in the beginning of the value to filter
commands for specific actions: create (a), modify (m), delete (d).
A `!` can be included in the modifiers to negate the reference prefix entry.
E.g.:
+
	git config --system --add receive.procReceiveRefs ad:refs/heads
	git config --system --add receive.procReceiveRefs !:refs/heads

receive.updateServerInfo::
	If set to true, git-receive-pack will run git-update-server-info
	after receiving data from git-push and updating refs.

receive.shallowUpdate::
	If set to true, .git/shallow can be updated when new refs
	require new shallow roots. Otherwise those refs are rejected.

Title: Git Receive Pack Configuration for Push Safety and Customization
Summary
Options for configuring git-receive-pack to control push operations, including settings for preventing deletions, non-fast-forward updates, and reference hiding, as well as customizing the update process with external hooks and server information updates.