Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH v2 06/15] user-manual: Give 'git push -f' as an alternative to +master

From: W. Trevor King <hidden>
Date: 2016-06-15 22:56:06

On Sun, Feb 10, 2013 at 02:00:50PM -0800, Junio C Hamano wrote:
"W. Trevor King" [off-list ref] writes:
quoted
+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
If you feel the need to explain it to the list, we should probably
have an explanatory example in the manual ;).  What about suggesting
`--dry-run` for sanity-checking forced pushes?

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help