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

Re: [PATCH v3 1/9] user-manual: Use 'remote add' to setup push URLs

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 18, 2013, 01:58 UTC
Message-ID
<7vbobie62v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<0016ba69f4157996dfbe66938056c4192bed62c1.1361146398.git.wking@tremily.us>
"W. Trevor King" <wking@tremily.us> writes:
Show 8 quoted lines
> From: "W. Trevor King" <wking@tremily.us>
>
> There is no need to use here documents to setup this configuration.
> It is easier, less confusing, and more robust to use `git remote add`
> directly.
>
> Signed-off-by: W. Trevor King <wking@tremily.us>
> ---

This looks like a good 'maint' material that can be applied straight away there in preparation for 1.8.1.4 to me; reviewers watching from the sideline, please stop me if you see issues.

Show 31 quoted lines
>  Documentation/user-manual.txt | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt
> index 5077e7c..a060eb6 100644
> --- a/Documentation/user-manual.txt
> +++ b/Documentation/user-manual.txt
> @@ -1998,16 +1998,21 @@ will not be updated by the push.  This may lead to unexpected results if
>  the branch you push to is the currently checked-out branch!
>  
>  As with `git fetch`, you may also set up configuration options to
> -save typing; so, for example, after
> +save typing; so, for example:
> +
> +-------------------------------------------------
> +$ git remote add public-repo ssh://yourserver.com/~you/proj.git
> +-------------------------------------------------
> +
> +adds the following to `.git/config`:
>  
>  -------------------------------------------------
> -$ cat >>.git/config <<EOF
>  [remote "public-repo"]
> -	url = ssh://yourserver.com/~you/proj.git
> -EOF
> +	url = yourserver.com:proj.git
> +	fetch = +refs/heads/*:refs/remotes/example/*
>  -------------------------------------------------
>  
> -you should be able to perform the above push with just
> +which lets you do the same push with just

As the additional "remote.public-repo.fetch" line hints, this does more than "lets you do the same push with just [lazily]"; it also starts pretending to have run a fetch from there immediately after you pushed and update the remote tracking branches. I couldn't decide if it is a good idea to point it out in this point of the flow as well, or it is too much detail that is not exactly relevant while teaching "git push". I tend to think it would be the latter.

Previous: W. Trevor KingNext: Jonathan Nieder
Message 16 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.