From: Jonathan Nieder <jrnieder@gmail.com>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] push: mention "git pull" in error message for non-fast forwards
Date: Mon, 2 Aug 2010 14:12:49 -0500 [thread overview]
Message-ID: <20100802191211.GA2180@burratino> (raw)
In-Reply-To: <1280756564-3932-1-git-send-email-Matthieu.Moy@imag.fr>
Hi Matthieu,
Matthieu Moy wrote:
> +++ b/builtin/push.c
> @@ -130,8 +130,8 @@ static int push_with_options(struct transport *transport, int flags)
>
> if (nonfastforward && advice_push_nonfastforward) {
> fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n"
> - "Merge the remote changes before pushing again. See the 'Note about\n"
> - "fast-forwards' section of 'git push --help' for details.\n");
> + "Merge the remote changes (e.g. 'git pull') before pushing again. See the\n"
> + "'Note about fast-forwards' section of 'git push --help' for details.\n");
Your change is good.
This reminds me: sometimes people blindly “git pull” a rebased history
just to avoid a non-fast-forward push, and it irks me to no end. So if
I were running the world, the output would be:
error: rejected non-fast-forward push to '<url>'
hint: To prevent you from losing history, non-fast-forward updates are
hint: rejected by default.
hint: See the 'Note about fast-forwards' section of 'git push --help'
hint: for details.
and the relevant section of the manual would explain that
1. if upstream is ahead of you, you may want to "git pull"
but
2. if upstream rebased, you may want to "git pull --rebase", and
yell at upstream a little while at it.
and
3. if the history you are pushing to is both (1) known to be unstable
and (2) wrong, you can override it with
"git push <remote> +<refspec>". Be sure to make sure the
“[receive] denyNonFastForwards” setting is unset correctly in this
case.
Jonathan
next prev parent reply other threads:[~2010-08-02 19:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-02 13:42 [PATCH] push: mention "git pull" in error message for non-fast forwards Matthieu Moy
2010-08-02 19:12 ` Jonathan Nieder [this message]
2010-08-02 19:52 ` Matthieu Moy
2010-08-02 22:11 ` Junio C Hamano
2010-08-05 13:14 ` Matthieu Moy
2010-08-12 10:03 ` Matthieu Moy
2010-08-12 19:28 ` Jonathan Nieder
2010-08-15 17:34 ` Matthieu Moy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100802191211.GA2180@burratino \
--to=jrnieder@gmail.com \
--cc=Matthieu.Moy@imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).