Re: [PATCH v2 06/15] user-manual: Give 'git push -f' as an alternative to +master
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:06
"W. Trevor King" [off-list ref] writes:
quoted hunk
From: "W. Trevor King" <redacted> This mirrors existing language in the description of 'git fetch'. Signed-off-by: W. Trevor King <redacted> --- 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