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

Re: Tracking parent branches in Git

From
Bryan Turner <bturner@atlassian.com>
Date
Jul 2, 2019, 18:52 UTC
Message-ID
<CAGyf7-GhD50Dy0O7JjV4vTyQfFcifyKzeYDS_HtAXy604HxqVQ@mail.gmail.com>
In-Reply-To
<xmqqef3849v6.fsf@gitster-ct.c.googlers.com>
On Tue, Jul 2, 2019 at 10:36 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
>
> In this whole thread, I have been wondering if I am missing
> something crucial, but now I am deeply puzzled why after many people
> made comments, nobody raises a question about the "--no-track" thing
> in the early message in the thread.
>
> If you do not add that, i.e.
>
>         $ git checout -t -b bturner-some-bugfix origin/release/5.16
>
> (note that I added '-t' for illustration, but it should be on by
> default when starting from origin/<whatever>), then you'd get in
> your configuration file these recorded:
>
>         $ git config --get-regexp 'branch\.bturner-some-bugfix\..*'
>         branch.bturner-some-bugfix.remote origin
>         branch.bturner-some-bugfix.merge refs/heads/release/5.16
>
> You created 'bturner-some-bugfix' branch out of the 'release/5.16'
> branch taken from the remote whose name is 'origin'.
>
> Is that different from the answer to the question being sought?
> What am I missing???

Sorry, I should have clarified my "--no-track" in my original message when I provided the example. I did "--no-track" because if I push "bturner-some-bugfix" to a server, I'm likely going to do something like "git push -u origin bturner-some-bugfix" so that my local "bturner-some-bugfix" branch will track the remote version of itself. At that point, the remote-tracking information would change from "release/5.16" to "bturner-some-bugfix" (without any sort of warning, for whatever that's worth), effectively "losing" the ancestry.

The other issue is that my local remote-tracking information doesn't help the server I'm talking to; it's not shareable. Assuming I could use remote-tracking to track ancestry, there's still no way to communicate that to the server so that it could know, when I go to create a pull request for "bturner-some-bugfix", that it's tracking "release/5.16" in my local repository.

I could certainly be misunderstanding the request, but I think it's asking for something less ephemeral--and more shareable--than remote-tracking, and it seems logical to want to be able to retain ancestry while still using remote-tracking setup such that local branches still track the remote version of themselves, rather than some other (albeit related) branch.

Best regards, Bryan Turner

Previous: Junio C HamanoNext: Theodore Ts'o
Message 7 of 13 in “Tracking parent branches in Git”
  1. Eric KulcykJul 1, 2019
  2. Junio C HamanoJul 1, 2019
  3. Bryan TurnerJul 1, 2019
  4. rsbecker@nexbridge.comJul 1, 2019
  5. Philip OakleyJul 2, 2019
  6. Junio C HamanoJul 2, 2019
  7. Bryan TurnerJul 2, 2019
  8. Theodore Ts'oJul 2, 2019
  9. Philip OakleyJul 3, 2019
  10. Eckhard MaaßJul 1, 2019
  11. Eric KulcykJul 1, 2019
  12. Eric KulcykJul 1, 2019
  13. Andreas KreyJul 2, 2019

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.