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

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
Previous: W. Trevor KingNext: W. Trevor King
Message 69 of 97 in “user-manual: Rewrite git-gc section for automatic packing”
  1. user-manual: Rewrite git-gc section for automatic packingW. Trevor King, Feb 8, 2013
  2. Junio C HamanoFeb 8, 2013
  3. W. Trevor KingFeb 8, 2013
  4. Junio C HamanoFeb 8, 2013
  5. Junio C HamanoFeb 8, 2013
  6. 00/15 User manual updatesW. Trevor King, Feb 10, 2013
  7. 01/15 user-manual: Rewrite git-gc section for automatic packingW. Trevor King, Feb 10, 2013
  8. 02/15 user-manual: Update for receive.denyCurrentBranch=refuseW. Trevor King, Feb 10, 2013
  9. Junio C HamanoFeb 10, 2013
  10. W. Trevor KingFeb 10, 2013
  11. Junio C HamanoFeb 10, 2013
  12. Junio C HamanoFeb 14, 2013
  13. W. Trevor KingFeb 17, 2013
  14. 0/9 User manual updatesW. Trevor King, Feb 18, 2013
  15. 1/9 user-manual: Use 'remote add' to setup push URLsW. Trevor King, Feb 18, 2013
  16. Junio C HamanoFeb 18, 2013
  17. Jonathan NiederFeb 18, 2013
  18. 2/9 user-manual: Reorganize the reroll sections, adding 'git rebase -i'W. Trevor King, Feb 18, 2013
  19. Junio C HamanoFeb 18, 2013
  20. W. Trevor KingFeb 18, 2013
  21. Junio C HamanoFeb 18, 2013
  22. 3/9 user-manual: Give 'git push -f' as an alternative to +masterW. Trevor King, Feb 18, 2013
  23. Junio C HamanoFeb 18, 2013
  24. 4/9 user-manual: Mention 'git remote add' for remote branch configW. Trevor King, Feb 18, 2013
  25. Junio C HamanoFeb 18, 2013
  26. W. Trevor KingFeb 18, 2013
  27. 5/9 user-manual: Standardize backtick quotingW. Trevor King, Feb 18, 2013
  28. user-manual: Standardize backtick quotingW. Trevor King, Feb 25, 2013
  29. 6/9 user-manual: Use 'git config --global user.*' for setupW. Trevor King, Feb 18, 2013
  30. Junio C HamanoFeb 18, 2013
  31. W. Trevor KingFeb 18, 2013
  32. 7/9 user-manual: Use request-pull to generate "please pull" textW. Trevor King, Feb 18, 2013
  33. Junio C HamanoFeb 18, 2013
  34. 8/9 user-manual: Flesh out uncommitted changes and submodule updatesW. Trevor King, Feb 18, 2013
  35. Junio C HamanoFeb 18, 2013
  36. W. Trevor KingFeb 19, 2013
  37. 9/9 user-manual: Use -o latest.tar.gz to create a gzipped tarballW. Trevor King, Feb 18, 2013
  38. Junio C HamanoFeb 18, 2013
  39. W. Trevor KingFeb 18, 2013
  40. Junio C HamanoFeb 18, 2013
  41. W. Trevor KingFeb 18, 2013
  42. W. Trevor KingFeb 19, 2013
  43. 0/3 User manual updatesW. Trevor King, Feb 19, 2013
  44. 1/3 user-manual: Reorganize the reroll sections, adding 'git rebase -i'W. Trevor King, Feb 19, 2013
  45. Junio C HamanoFeb 19, 2013
  46. W. Trevor KingFeb 19, 2013
  47. Junio C HamanoFeb 19, 2013
  48. user-manual: Fix the interactive rebase example commit rangeW. Trevor King, Mar 24, 2013
  49. Eric SunshineMar 24, 2013
  50. W. Trevor KingMar 24, 2013
  51. 2/3 user-manual: Use request-pull to generate "please pull" textW. Trevor King, Feb 19, 2013
  52. 3/3 user-manual: Flesh out uncommitted changes and submodule updatesW. Trevor King, Feb 19, 2013
  53. Drew NorthupFeb 18, 2013
  54. Junio C HamanoFeb 18, 2013
  55. 03/15 user-manual: Use 'remote add' to setup push URLsW. Trevor King, Feb 10, 2013
  56. Junio C HamanoFeb 10, 2013
  57. W. Trevor KingFeb 10, 2013
  58. Jonathan NiederFeb 10, 2013
  59. W. Trevor KingFeb 10, 2013
  60. Junio C HamanoFeb 10, 2013
  61. W. Trevor KingFeb 10, 2013
  62. 04/15 user-manual: Use git branch --mergedW. Trevor King, Feb 10, 2013
  63. Junio C HamanoFeb 10, 2013
  64. W. Trevor KingFeb 10, 2013
  65. 05/15 user-manual: Add a few references to 'git rebase -i'W. Trevor King, Feb 10, 2013
  66. Junio C HamanoFeb 10, 2013
  67. W. Trevor KingFeb 10, 2013
  68. 06/15 user-manual: Give 'git push -f' as an alternative to +masterW. Trevor King, Feb 10, 2013
  69. Junio C HamanoFeb 10, 2013
  70. W. Trevor KingFeb 10, 2013
  71. Junio C HamanoFeb 10, 2013
  72. 07/15 user-manual: Mention 'git remote add' for remote branch configW. Trevor King, Feb 10, 2013
  73. Junio C HamanoFeb 10, 2013
  74. Junio C HamanoFeb 10, 2013
  75. W. Trevor KingFeb 10, 2013
  76. 08/15 user-manual: Standardize backtick quotingW. Trevor King, Feb 10, 2013
  77. W. Trevor KingFeb 10, 2013
  78. 09/15 user-manual: Use 'git config --global user.*' for setupW. Trevor King, Feb 10, 2013
  79. Junio C HamanoFeb 10, 2013
  80. W. Trevor KingFeb 10, 2013
  81. Junio C HamanoFeb 10, 2013
  82. W. Trevor KingFeb 10, 2013
  83. 10/15 user-manual: Fix 'both: so' -> 'both; so' typoW. Trevor King, Feb 10, 2013
  84. 11/15 user-manual: Fix 'http' -> 'HTTP' typosW. Trevor King, Feb 10, 2013
  85. 12/15 user-manual: Use request-pull to generate "please pull" textW. Trevor King, Feb 10, 2013
  86. Junio C HamanoFeb 10, 2013
  87. W. Trevor KingFeb 10, 2013
  88. 13/15 user-manual: Fix 'you - Git' -> 'you--Git' typoW. Trevor King, Feb 10, 2013
  89. 14/15 user-manual: Flesh out uncommitted changes and submodule updatesW. Trevor King, Feb 10, 2013
  90. 15/15 user-manual: Use --format=tar.gz to create a gzipped tarballW. Trevor King, Feb 10, 2013
  91. Junio C HamanoFeb 10, 2013
  92. W. Trevor KingFeb 10, 2013
  93. Junio C HamanoFeb 10, 2013
  94. W. Trevor KingFeb 10, 2013
  95. Junio C HamanoFeb 10, 2013
  96. W. Trevor KingFeb 10, 2013
  97. Javier TiaFeb 9, 2013

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.