Re: [PATCH] push: mention "git pull" in error message for non-fast forwards
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2010, 22:11 UTC
- Message-ID
- <7vfwywk6lr.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20100802191211.GA2180@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 9 quoted lines
> 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.
Show 16 quoted lines
> 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