1
0
mirror of https://github.com/git/git.git synced 2024-10-03 11:41:26 +02:00
git/Documentation
Jeff King 986e82396a receive-pack: detect push to current branch of non-bare repo
Pushing into the currently checked out branch of a non-bare
repository can be dangerous; the HEAD then loses sync with
the index and working tree, and it looks in the receiving
repo as if the pushed changes have been reverted in the
index (since they were never there in the first place).

This patch adds a safety valve that checks for this
condition and either generates a warning or denies the
update. We trigger the check only on a non-bare repository,
since a bare repo does not have a working tree (and in fact,
pushing to the HEAD branch is a common workflow for
publishing repositories).

The behavior is configurable via receive.denyCurrentBranch,
defaulting to "warn" so as not to break existing setups
(though it may, after a deprecation period, switch to
"refuse" by default). For users who know what they are doing
and want to silence the warning (e.g., because they have a
post-receive hook that reconciles the HEAD and working
tree), they can turn off the warning by setting it to false
or "ignore".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-11-09 10:16:50 -08:00
..
howto Documentation: remove stale howto/rebase-and-edit.txt 2008-10-12 11:31:55 -07:00
technical run-command.c: remove run_command_v_opt_cd() 2008-10-02 18:02:44 -07:00
.gitattributes
.gitignore doc: adding gitman.info and *.texi to .gitignore 2008-06-12 14:28:53 -07:00
asciidoc.conf asciidoc: add minor workaround to add an empty line after code blocks 2008-10-30 23:41:28 -07:00
blame-options.txt builtin-blame: Reencode commit messages according to git-log rules. 2008-10-21 14:09:34 -07:00
build-docdep.perl
callouts.xsl
cat-texi.perl Documentation: exclude @pxref{[REMOTES]} from texinfo intermediate output 2008-06-12 14:21:05 -07:00
cmd-list.perl
CodingGuidelines Rename path_list to string_list 2008-07-21 19:11:50 -07:00
config.txt receive-pack: detect push to current branch of non-bare repo 2008-11-09 10:16:50 -08:00
diff-format.txt Add reference for status letters in documentation. 2008-11-02 15:57:10 -08:00
diff-generate-patch.txt git-diff(1): "--c" -> "--cc" typo fix 2008-08-01 23:21:23 -07:00
diff-options.txt Merge branch 'maint' 2008-10-18 08:26:44 -07:00
docbook-xsl.css
docbook.xsl
everyday.txt git-gc --prune is deprecated 2008-04-22 21:53:37 -07:00
fetch-options.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
fix-texi.perl
git-add.txt document "intent to add" option to git-add 2008-10-20 19:34:56 -07:00
git-am.txt git-am: ignore --binary option 2008-08-16 02:32:36 -07:00
git-annotate.txt Mention the fact that 'git annotate' is only for backward compatibility. 2008-09-05 01:15:40 -07:00
git-apply.txt git-apply:--include=pathspec 2008-09-06 18:56:44 -07:00
git-archimport.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-archive.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-bisect.txt manpages: italicize gitk's name (where it was in teletype font) 2008-07-05 11:24:40 -07:00
git-blame.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-branch.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-bundle.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-cat-file.txt Documentation: typos / spelling fixes 2008-08-05 21:21:18 -07:00
git-check-attr.txt Merge branch 'dp/checkattr' 2008-10-19 16:06:47 -07:00
git-check-ref-format.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-checkout-index.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-checkout.txt Documentation: Spelling fix 2008-10-19 13:08:14 -07:00
git-cherry-pick.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-cherry.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-citool.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-clean.txt Make the DESCRIPTION match <x>... items in the SYNOPSIS 2008-07-30 21:42:55 -07:00
git-clone.txt Implement git clone -v 2008-10-09 11:26:17 -07:00
git-commit-tree.txt Fix passwd(5) ref and reflect that commit doens't use commit-tree 2008-09-03 14:51:19 -07:00
git-commit.txt Merge branch 'tr/workflow-doc' 2008-10-19 16:07:23 -07:00
git-config.txt Documentation: fix diff.external example 2008-08-01 22:45:27 -07:00
git-count-objects.txt count-objects: Add total pack size to verbose output 2008-08-17 01:01:42 -07:00
git-cvsexportcommit.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-cvsimport.txt Merge branch 'qq/maint' 2008-07-05 18:33:16 -07:00
git-cvsserver.txt adapt git-cvsserver manpage to dash-free syntax 2008-08-18 22:05:44 -07:00
git-daemon.txt git-daemon: set REMOTE_ADDR to client address 2008-10-24 16:34:01 -07:00
git-describe.txt describe: Make --tags and --all match lightweight tags more often 2008-10-17 11:35:43 -07:00
git-diff-files.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-diff-index.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-diff-tree.txt Teach git diff-tree --stdin to diff trees 2008-08-11 01:35:47 -07:00
git-diff.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-fast-export.txt Support copy and rename detection in fast-export. 2008-07-29 23:57:51 -07:00
git-fast-import.txt Support gitlinks in fast-import. 2008-07-19 11:25:51 -07:00
git-fetch-pack.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-fetch.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-filter-branch.txt Documentation: Refer to git-rebase(1) to warn against rewriting 2008-09-15 21:22:58 -07:00
git-fmt-merge-msg.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-for-each-ref.txt for-each-ref: :short format for refname 2008-09-05 23:06:37 -07:00
git-format-patch.txt Merge branch 'maint' 2008-11-04 15:11:26 -08:00
git-fsck-objects.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-fsck.txt manpages: italicize nongit command names (if they are in teletype font) 2008-07-05 11:24:40 -07:00
git-gc.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-get-tar-commit-id.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-grep.txt git grep: Add "-z/--null" option as in GNU's grep. 2008-10-01 09:14:54 -07:00
git-gui.txt manpages: use teletype font for sample command lines 2008-07-05 11:24:40 -07:00
git-hash-object.txt add --no-filters option to git hash-object 2008-08-03 13:38:22 -07:00
git-help.txt builtin-help: fallback to GIT_MAN_VIEWER before man 2008-08-29 21:46:33 -07:00
git-http-fetch.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-http-push.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-imap-send.txt Documentation: Improve documentation for git-imap-send(1) 2008-07-25 21:51:30 -07:00
git-index-pack.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-init-db.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-init.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-instaweb.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-log.txt Improve git-log documentation wrt file filters 2008-10-01 08:21:22 -07:00
git-lost-found.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-ls-files.txt Documentation: clarify what is shown in "git-ls-files -s" output 2008-07-28 23:02:11 -07:00
git-ls-remote.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-ls-tree.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-mailinfo.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-mailsplit.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-merge-base.txt documentation: merge-base: explain "git merge-base" with more than 2 args 2008-07-29 23:17:35 -07:00
git-merge-file.txt manpages: italicize nongit command names (if they are in teletype font) 2008-07-05 11:24:40 -07:00
git-merge-index.txt manpages: italicize nongit command names (if they are in teletype font) 2008-07-05 11:24:40 -07:00
git-merge-one-file.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-merge-tree.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-merge.txt Merge branch 'jc/better-conflict-resolution' 2008-09-29 10:15:07 -07:00
git-mergetool.txt Documentation: typos / spelling fixes 2008-08-05 21:21:18 -07:00
git-mktag.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-mktree.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-mv.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-name-rev.txt Fix example in git-name-rev documentation 2008-08-30 13:23:01 -07:00
git-pack-objects.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-pack-redundant.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-pack-refs.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-parse-remote.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-patch-id.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-peek-remote.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-prune-packed.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-prune.txt make prune report removed objects on -v 2008-09-30 14:30:00 -07:00
git-pull.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-push.txt git-push.txt: Describe --repo option in more detail 2008-10-08 07:15:53 -07:00
git-quiltimport.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-read-tree.txt Correct typos in RelNotes-1.6.1 2008-09-30 11:51:16 -07:00
git-rebase.txt Merge branch 'tr/workflow-doc' 2008-10-19 16:07:23 -07:00
git-receive-pack.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-reflog.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-relink.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-remote.txt manpages: italicize command names in synopses 2008-07-05 11:24:39 -07:00
git-repack.txt git-repack uses --no-repack-object, not --no-repack-delta. 2008-09-19 22:23:14 -07:00
git-repo-config.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-request-pull.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-rerere.txt Merge branch 'maint' 2008-08-09 01:40:08 -07:00
git-reset.txt Documentation: Refer to git-rebase(1) to warn against rewriting 2008-09-15 21:22:58 -07:00
git-rev-list.txt Documentation: remove '\' in front of short options 2008-10-01 08:18:46 -07:00
git-rev-parse.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-revert.txt Add hints to revert documentation about other ways to undo changes 2008-08-20 16:04:45 -07:00
git-rm.txt builtin-rm: Add a --force flag 2008-08-08 18:27:19 -07:00
git-send-email.txt send-email: signedoffcc -> signedoffbycc, but handle both 2008-10-01 08:56:58 -07:00
git-send-pack.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-sh-setup.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-shell.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-shortlog.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-show-branch.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-show-index.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-show-ref.txt Make the DESCRIPTION match <x>... items in the SYNOPSIS 2008-07-30 21:42:55 -07:00
git-show.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-stash.txt Documentation: minor cleanup in a use case in 'git stash' manual 2008-09-01 22:02:11 -07:00
git-status.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-stripspace.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-submodule.txt git-submodule: add "sync" command 2008-08-25 22:48:01 -07:00
git-svn.txt Add git-svn branch to allow branch creation in SVN repositories 2008-10-06 09:00:55 -07:00
git-symbolic-ref.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-tag.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-tar-tree.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-tools.txt
git-unpack-file.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-unpack-objects.txt Documentation formatting and cleanup 2008-07-01 17:20:16 -07:00
git-update-index.txt Make use of stat.ctime configurable 2008-07-28 23:26:25 -07:00
git-update-ref.txt Documentation: be consistent about "git-" versus "git " 2008-07-01 17:20:15 -07:00
git-update-server-info.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-upload-archive.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-upload-pack.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git-var.txt Fix passwd(5) ref and reflect that commit doens't use commit-tree 2008-09-03 14:51:19 -07:00
git-verify-pack.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-verify-tag.txt Make the DESCRIPTION match <x>... items in the SYNOPSIS 2008-07-30 21:42:55 -07:00
git-web--browse.txt git-web--browse: Support for using /bin/start on MinGW 2008-09-24 15:49:21 -07:00
git-whatchanged.txt Update my e-mail address 2008-08-01 23:21:44 -07:00
git-write-tree.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
git.txt GIT 1.6.0.2 2008-09-12 16:18:47 -07:00
gitattributes.txt Merge branch 'maint' 2008-11-02 00:15:22 -07:00
gitcli.txt gitcli: Document meaning of --cached and --index 2008-07-01 17:29:38 -07:00
gitcore-tutorial.txt Adjust for the new way of enabling the default post-update hook 2008-08-11 17:07:17 -07:00
gitcvs-migration.txt Merge branch 'qq/maint' 2008-07-05 18:33:16 -07:00
gitdiffcore.txt Bust the ghost of long-defunct diffcore-pathspec. 2008-09-19 19:48:30 -07:00
gitglossary.txt Documentation: fix broken "linkgit" links 2008-07-08 13:02:11 -07:00
githooks.txt docs: describe pre-rebase hook 2008-10-06 01:17:05 -07:00
gitignore.txt Documentation: How to ignore local changes in tracked files 2008-07-19 11:17:43 -07:00
gitk.txt Document gitk --argscmd flag. 2008-08-29 00:14:29 -07:00
gitmodules.txt Document clarification: gitmodules, gitattributes 2008-08-31 16:31:58 -07:00
gitrepository-layout.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
gittutorial-2.txt tutorial: update output of git commit 2008-10-06 00:04:24 -07:00
gittutorial.txt tutorial: gentler illustration of Alice/Bob workflow using gitk 2008-08-29 00:14:30 -07:00
gitworkflows.txt workflows documentation: fix link to git-request-pull[1] 2008-10-20 23:39:37 -07:00
glossary-content.txt glossary: improve a few links 2008-06-01 22:26:37 -07:00
howto-index.sh
i18n.txt builtin-blame: Reencode commit messages according to git-log rules. 2008-10-21 14:09:34 -07:00
install-doc-quick.sh install-doc-quick - use git --exec-path to find git-sh-setup 2008-07-08 16:36:03 -07:00
install-webdoc.sh
Makefile Makefile: add install-man rules (quick and normal) 2008-11-02 20:46:52 -08:00
manpage-1.72.xsl
merge-config.txt Fix some manual typos. 2008-09-12 13:19:56 -07:00
merge-options.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
merge-strategies.txt
pretty-formats.txt add '%d' pretty format specifier to show decoration 2008-09-04 17:01:41 -07:00
pretty-options.txt
pull-fetch-param.txt Merge branch 'maint' 2008-08-09 01:40:08 -07:00
RelNotes-1.5.0.1.txt
RelNotes-1.5.0.2.txt
RelNotes-1.5.0.3.txt
RelNotes-1.5.0.4.txt
RelNotes-1.5.0.5.txt
RelNotes-1.5.0.6.txt
RelNotes-1.5.0.7.txt
RelNotes-1.5.0.txt
RelNotes-1.5.1.1.txt
RelNotes-1.5.1.2.txt
RelNotes-1.5.1.3.txt
RelNotes-1.5.1.4.txt
RelNotes-1.5.1.5.txt
RelNotes-1.5.1.6.txt
RelNotes-1.5.1.txt
RelNotes-1.5.2.1.txt
RelNotes-1.5.2.2.txt
RelNotes-1.5.2.3.txt
RelNotes-1.5.2.4.txt
RelNotes-1.5.2.5.txt
RelNotes-1.5.2.txt Documentation: typos / spelling fixes in older RelNotes 2008-08-05 11:38:11 -07:00
RelNotes-1.5.3.1.txt
RelNotes-1.5.3.2.txt
RelNotes-1.5.3.3.txt
RelNotes-1.5.3.4.txt
RelNotes-1.5.3.5.txt
RelNotes-1.5.3.6.txt
RelNotes-1.5.3.7.txt
RelNotes-1.5.3.8.txt
RelNotes-1.5.3.txt Documentation: typos / spelling fixes in older RelNotes 2008-08-05 11:38:11 -07:00
RelNotes-1.5.4.1.txt
RelNotes-1.5.4.2.txt
RelNotes-1.5.4.3.txt
RelNotes-1.5.4.4.txt Documentation: typos / spelling fixes in older RelNotes 2008-08-05 11:38:11 -07:00
RelNotes-1.5.4.5.txt Documentation: typos / spelling fixes in older RelNotes 2008-08-05 11:38:11 -07:00
RelNotes-1.5.4.6.txt GIT 1.5.4.6 2008-06-26 17:11:21 -07:00
RelNotes-1.5.4.txt
RelNotes-1.5.5.1.txt GIT 1.5.5.1 2008-04-20 11:36:53 -07:00
RelNotes-1.5.5.2.txt Release Notes for 1.5.5.2 2008-05-25 21:11:24 -07:00
RelNotes-1.5.5.3.txt GIT 1.5.5.3 2008-05-27 22:32:47 -07:00
RelNotes-1.5.5.4.txt GIT 1.5.5.4 2008-06-07 11:45:48 -07:00
RelNotes-1.5.5.5.txt GIT 1.5.5.5 2008-06-26 17:59:51 -07:00
RelNotes-1.5.5.txt GIT 1.5.5 2008-04-07 21:57:43 -07:00
RelNotes-1.5.6.1.txt GIT 1.5.6.1 2008-06-25 17:13:48 -07:00
RelNotes-1.5.6.2.txt GIT 1.5.6.2 2008-07-04 01:38:41 -07:00
RelNotes-1.5.6.3.txt GIT 1.5.6.3 2008-07-13 15:23:43 -07:00
RelNotes-1.5.6.4.txt GIT 1.5.6.4 2008-07-19 10:58:01 -07:00
RelNotes-1.5.6.5.txt GIT 1.5.6.5 2008-08-06 13:40:53 -07:00
RelNotes-1.5.6.txt GIT 1.5.6 2008-06-18 13:09:43 -07:00
RelNotes-1.6.0.1.txt GIT 1.6.0.1 2008-08-24 14:47:24 -07:00
RelNotes-1.6.0.2.txt Update draft release notes for 1.6.0.2 2008-09-10 13:38:20 -07:00
RelNotes-1.6.0.3.txt GIT 1.6.0.3 2008-10-21 13:37:42 -07:00
RelNotes-1.6.0.4.txt GIT 1.6.0.4 2008-11-08 21:29:22 -08:00
RelNotes-1.6.0.txt GIT 1.6.0 2008-08-17 11:42:10 -07:00
RelNotes-1.6.1.txt Update draft release notes to 1.6.1 2008-11-05 12:20:55 -08:00
rev-list-options.txt Merge branch 'maint' 2008-11-02 16:36:40 -08:00
SubmittingPatches Merge branch 'maint' 2008-11-02 00:15:22 -07:00
urls-remotes.txt manpages: italicize git command names (which were in teletype font) 2008-07-05 11:24:40 -07:00
urls.txt
user-manual.conf
user-manual.txt git-remote: list branches in vertical lists 2008-10-22 18:05:38 -07:00