git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] push: mention "git pull" in error message for non-fast forwards

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Aug 5, 2010, 13:14 UTC
Message-ID
<vpqiq3pp5gk.fsf@bauges.imag.fr>
In-Reply-To
<7vfwywk6lr.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
>
>> 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.
>
> I actually like that ;-)
>
> Since we are discussing the "advice" part of the output, I don't think it
> is so bad to add the three-bullet list below to it, either, though.

The error message is one that a normal user can see relatively regularly, as soon as he shares a bare-repository with co-workers, so I think it should remain short. That's why I took great care to remain within 3 lines in my patch.

Perhaps the manpage can be improved, but that's a separate topic. My one-line patch would make a great improvement for beginners, without harming advanced users, who still get the pointer to the doc.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Matthieu Moy
Message 5 of 8 in “push: mention "git pull" in error message for non-fast forwards”
  1. push: mention "git pull" in error message for non-fast forwardsMatthieu Moy, Aug 2, 2010
  2. Jonathan NiederAug 2, 2010
  3. Matthieu MoyAug 2, 2010
  4. Junio C HamanoAug 2, 2010
  5. Matthieu MoyAug 5, 2010
  6. Matthieu MoyAug 12, 2010
  7. Jonathan NiederAug 12, 2010
  8. Matthieu MoyAug 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.