Re: [PATCH v2 06/15] user-manual: Give 'git push -f' as an alternative to +master
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 10, 2013, 22:00 UTC
- Message-ID
- <7vsj53sub1.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <f0f8b77a3487be30ee4c492899fe73af05e20413.1360508415.git.wking@tremily.us>
"W. Trevor King" <wking@tremily.us> writes:
Show 24 quoted lines
> From: "W. Trevor King" <wking@tremily.us> > > This mirrors existing language in the description of 'git fetch'. > > Signed-off-by: W. Trevor King <wking@tremily.us> > --- > Documentation/user-manual.txt | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt > index 5d80b40..a68d6b9 100644 > --- a/Documentation/user-manual.txt > +++ b/Documentation/user-manual.txt > @@ -2045,6 +2045,13 @@ branch name with a plus sign: > $ git push ssh://yourserver.com/~you/proj.git +master > ------------------------------------------------- > > +Note the addition of the `+` sign. Alternatively, you can use the > +`-f` flag to force the remote update, as in: > + > +------------------------------------------------- > +$ git push -f ssh://yourserver.com/~you/proj.git master > +------------------------------------------------- > +
I didn't check the surrounding examples but would it make it a bit too advanced to make the example flow push out more than one branches here (perhaps he is also updating the 'maint' branch)? Then use of "--force" can be explained as "Instead of adding + to each and every refs to be pushed, you can use a single -f to force everything."
The mistake I would want to avoid teaching the readers is to replace
push $there +master maint
with
push -f $there master maint
or even worse
push -f $there
push -f