git-commit-vandalism/Documentation
Christopher Tiwald f25950f347 push: Provide situational hints for non-fast-forward errors
Pushing a non-fast-forward update to a remote repository will result in
an error, but the hint text doesn't provide the correct resolution in
every case. Give better resolution advice in three push scenarios:

1) If you push your current branch and it triggers a non-fast-forward
error, you should merge remote changes with 'git pull' before pushing
again.

2) If you push to a shared repository others push to, and your local
tracking branches are not kept up to date, the 'matching refs' default
will generate non-fast-forward errors on outdated branches. If this is
your workflow, the 'matching refs' default is not for you. Consider
setting the 'push.default' configuration variable to 'current' or
'upstream' to ensure only your current branch is pushed.

3) If you explicitly specify a ref that is not your current branch or
push matching branches with ':', you will generate a non-fast-forward
error if any pushed branch tip is out of date. You should checkout the
offending branch and merge remote changes before pushing again.

Teach transport.c to recognize these scenarios and configure push.c
to hint for them. If 'git push's default behavior changes or we
discover more scenarios, extension is easy. Standardize on the
advice API and add three new advice variables, 'pushNonFFCurrent',
'pushNonFFDefault', and 'pushNonFFMatching'. Setting any of these
to 'false' will disable their affiliated advice. Setting
'pushNonFastForward' to false will disable all three, thus preserving the
config option for users who already set it, but guaranteeing new
users won't disable push advice accidentally.

Based-on-patch-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Christopher Tiwald <christiwald@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-03-19 21:42:06 -07:00
..
howto request-pull: explicitly ask tags/$name to be pulled 2012-01-31 21:27:58 -08:00
pt_BR
RelNotes Git 1.7.10-rc1 2012-03-14 15:47:45 -07:00
technical Merge branch 'tr/maint-bundle-long-subject' into maint 2012-03-04 22:16:30 -08:00
.gitattributes
.gitignore
asciidoc.conf
blame-options.txt
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines CodingGuidelines: do not use 'which' in shell scripts 2012-02-27 15:10:23 -08:00
config.txt push: Provide situational hints for non-fast-forward errors 2012-03-19 21:42:06 -07:00
date-formats.txt
diff-config.txt diff --stat: add config option to limit graph width 2012-03-01 09:15:58 -08:00
diff-format.txt
diff-generate-patch.txt
diff-options.txt Merge branch 'zj/diff-stat-dyncol' 2012-03-06 14:53:06 -08:00
docbook-xsl.css
docbook.xsl
everyday.txt
fetch-options.txt
fix-texi.perl
git-add.txt
git-am.txt Merge branch 'tr/maint-mailinfo' 2012-01-29 13:18:53 -08:00
git-annotate.txt
git-apply.txt
git-archimport.txt
git-archive.txt
git-bisect-lk2009.txt
git-bisect.txt
git-blame.txt
git-branch.txt Documentation/git-branch: add default for --contains 2012-03-06 11:43:23 -08:00
git-bundle.txt
git-cat-file.txt
git-check-attr.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt
git-commit-tree.txt
git-commit.txt
git-config.txt Merge branch 'maint' 2012-03-01 14:45:14 -08:00
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt
git-difftool.txt
git-fast-export.txt
git-fast-import.txt
git-fetch-pack.txt
git-fetch.txt
git-filter-branch.txt
git-fmt-merge-msg.txt Document merge.branchdesc configuration variable 2012-02-23 11:20:15 -08:00
git-for-each-ref.txt
git-format-patch.txt
git-fsck-objects.txt
git-fsck.txt fsck doc: a minor typofix 2012-03-05 11:32:19 -08:00
git-gc.txt
git-get-tar-commit-id.txt
git-grep.txt
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt
git-init-db.txt
git-init.txt
git-instaweb.txt
git-log.txt
git-lost-found.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt merge: use editor by default in interactive sessions 2012-01-23 14:34:55 -08:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt
git-p4.txt Merge branch 'maint' 2012-02-26 17:39:04 -08:00
git-pack-objects.txt
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-peek-remote.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt
git-push.txt push: add '--prune' option 2012-02-22 18:17:39 -08:00
git-quiltimport.txt
git-read-tree.txt
git-rebase.txt
git-receive-pack.txt
git-reflog.txt
git-relink.txt
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txt
git-remote-testgit.txt
git-remote.txt Merge branch 'pj/remote-set-branches-usage-fix' into maint 2012-02-27 15:33:33 -08:00
git-repack.txt fsck: --no-dangling omits "dangling object" information 2012-02-28 14:55:39 -08:00
git-replace.txt
git-repo-config.txt
git-request-pull.txt
git-rerere.txt rerere: Document 'rerere remaining' 2012-03-08 14:40:44 -08:00
git-reset.txt
git-rev-list.txt
git-rev-parse.txt
git-revert.txt
git-rm.txt
git-send-email.txt send-email: document the --smtp-debug option 2012-02-27 10:29:24 -08:00
git-send-pack.txt
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-stage.txt
git-stash.txt
git-status.txt
git-stripspace.txt
git-submodule.txt
git-svn.txt
git-symbolic-ref.txt symbolic-ref --short: abbreviate the output unambiguously 2012-02-27 15:58:36 -08:00
git-tag.txt tag: add --points-at list option 2012-02-08 19:59:41 -08:00
git-tar-tree.txt
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-pack.txt
git-verify-tag.txt
git-web--browse.txt
git-whatchanged.txt
git-write-tree.txt
git.txt Git 1.7.9.4 2012-03-12 15:52:52 -07:00
gitattributes.txt Add a setting to require a filter to be successful 2012-02-17 07:37:08 -08:00
gitcli.txt
gitcore-tutorial.txt Use correct grammar in diffstat summary line 2012-02-03 23:19:42 -08:00
gitcredentials.txt
gitcvs-migration.txt
gitdiffcore.txt
gitglossary.txt
githooks.txt
gitignore.txt
gitk.txt
gitmodules.txt
gitnamespaces.txt
gitrepository-layout.txt
gitrevisions.txt
gittutorial-2.txt Use correct grammar in diffstat summary line 2012-02-03 23:19:42 -08:00
gittutorial.txt
gitweb.conf.txt
gitweb.txt
gitworkflows.txt
glossary-content.txt
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
mailmap.txt
Makefile
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt
merge-options.txt Merge branch 'jc/doc-merge-options' 2012-02-26 23:05:42 -08:00
merge-strategies.txt
pretty-formats.txt
pretty-options.txt
pull-fetch-param.txt
rev-list-options.txt Documentation: use {asterisk} in rev-list-options.txt when needed 2012-02-28 13:17:14 -08:00
revisions.txt Documentation: do not assume that n > 1 in <rev>~$n 2012-03-02 09:33:29 -08:00
sequencer.txt
SubmittingPatches
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt fsck: --no-dangling omits "dangling object" information 2012-02-28 14:55:39 -08:00