The receive.denyCurrentBranch
config option controls what happens if you push to a repo's branch that is checkout.
By default, it rejects it (which is why you usually only push to bare repos, which have no checkout branches).
It can be disabled via ignore
or warn
.
Another option is updateInstead
.
What this does is that if the HEAD
and working directory are the same, and the branch being pushed is HEAD
, both the working directory and the branch/HEAD
are updated at the same time.
If the working directory is different from HEAD
, the push is rejected.
This is useful, for pushing to webservers, for example.
My question is, does this option interact with the Index at all?
Is the Index updated? What if HEAD
and the working directory match, but not Index
?