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

Re: man page for "git remote set-url" seems confusing/contradictory

From
Jacob Keller <jacob.keller@gmail.com>
Date
Apr 17, 2018, 17:41 UTC
Message-ID
<CA+P7+xrebnWe_6P0uGu2yEmXZ0+qjpykjrv39Nhd2hUPzO_96g@mail.gmail.com>
In-Reply-To
<alpine.LFD.2.21.1804170831190.6019@localhost.localdomain>
On Tue, Apr 17, 2018 at 8:34 AM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
Show 35 quoted lines
> On Tue, 17 Apr 2018, Junio C Hamano wrote:
>
>> Jacob Keller <jacob.keller@gmail.com> writes:
>>
>> > Things won't work so well if you set the push url and fetch url to
>> > different repositories. Git assumes that refs updated by "push"
>> > will also be reflected via "fetch".
>> >
>> > I don't know offhand what will break, but likely something will.
>> > For one, when you fetch again it will rewind your remotes after
>> > the push.
>>
>> Exactly.  I still haven't fully embraced it myself, but for a long
>> time, "git push" pretends as if it fetched from that remote and
>> updates the corresponding remote tracking branches (if you have
>> any), so you'll be inviting inconsistent behaviour if you set your
>> fetch and push URLs pointing at two logically separate places.
>
>   ... snip ...
>
>   oh, i totally buy all that now, i'm just suggesting that the man
> page might be tweaked to make that more obvious. in "man git-remote",
> under "set-url", remember that it reads:
>
> "Note that the push URL and the fetch URL, even though they can be set
> differently, must still refer to the same place."
>
>   i think it would be useful to be more specific about what "can be
> set differently" means, since a lot of readers might not immediately
> appreciate that it means just, say, the transport protocols. it never
> hurts to add that little bit of detail.
>
> rday
>
>
Maybe something like:

"Note that the push URL and the fetch URL, even though they can be set differently, are expected to refer to the same repository. For example, the fetch URL might use an unauthenticated transport, while the push URL generally requires authentication" Then follow this bit with the mention of multiple remotes.

(I think "repository" conveys the meaning better than "place". Technically, the URLs can be completely different as long as they end up contacting the same real server repository.)

Thanks, Jake

Previous: Robert P. J. DayNext: Junio C Hamano
Message 8 of 12 in “man page for "git remote set-url" seems confusing/contradictory”
  1. Robert P. J. DayApr 16, 2018
  2. Andreas SchwabApr 16, 2018
  3. Robert P. J. DayApr 16, 2018
  4. Jacob KellerApr 16, 2018
  5. Junio C HamanoApr 16, 2018
  6. Jacob KellerApr 17, 2018
  7. Robert P. J. DayApr 17, 2018
  8. Jacob KellerApr 17, 2018
  9. Junio C HamanoApr 18, 2018
  10. Todd ZullingerApr 18, 2018
  11. Martin ÅgrenApr 19, 2018
  12. doc/clone: update caption for GIT URLS cross-referenceTodd Zullinger, Apr 19, 2018

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.