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

Re: [PATCH v2 1/1] gitfaq: append the 'Common Issues' section

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 21, 2020, 18:00 UTC
Message-ID
<xmqqo8rkoh27.fsf@gitster.c.googlers.com>
In-Reply-To
<20200421083820.GB11800@konoha>
Shourya Shukla <shouryashukla.oo@gmail.com> writes:
> I thought it would be OK to describe a maybe *unorthodox* way to do
> this. I will remove it in the next version.

The thing is that it is not just unorthodox but it is wrong and broken.

Imagine that your 'origin' fetches from upstream that is controlled by me (e.g. at https://github.com/git/git/) and pushes to your publishing repository controled by you. After you fetch from me after my 'master' branch advances, of course, remote/origin/master would be updated in your repository. When you work on your own changes on your 'master' (perhaps you do "pull --rebase origin") and push the result to your publishing repository, which you also call 'origin' because you configured the remotes in your "unorthodox" way, the remote-tracking branch remotes/origin/master would also be updated from your 'master' (i.e. we pretend that we fetched the remote-tracking branches from the same remote immediately after we pushed out). But if you actually fetch from 'origin', I wouldn't have your changes on my 'master' yet, and you won't be seeing your commits in your remotes/origin/master.

I.e. the "unorthodox" way breaks your remote-tracking branch, and not recommendable for any usecase.

Having said all that, because this is a single-topic FAQ entry that covers only the "remote", we should clarify the existing description in Documentation/git-remote.txt and also possibly config variables the subsystem uses so that anything readers would learn by understanding these three bullet points we just discussed are covered there. And then have a small paragraph that has only the question and "see that section on that manual page" reference, and no duplicated explanation, in the FAQ file.

Previous: Shourya Shukla
Message 10 of 10 in “update gitfaq”
  1. 0/1 update gitfaqShourya Shukla, Apr 13, 2020
  2. 1/1 gitfaq: append the 'Common Issues' sectionShourya Shukla, Apr 13, 2020
  3. brian m. carlsonApr 14, 2020
  4. Junio C HamanoApr 14, 2020
  5. Junio C HamanoApr 16, 2020
  6. Shourya ShuklaApr 21, 2020
  7. Junio C HamanoApr 16, 2020
  8. Junio C HamanoApr 21, 2020
  9. Shourya ShuklaApr 21, 2020
  10. Junio C HamanoApr 21, 2020

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.