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

Re: Tracking parent branches in Git

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 2, 2019, 17:36 UTC
Message-ID
<xmqqef3849v6.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<77a2b000-f1dc-6f3e-54db-abd227ce6163@iee.org>
Philip Oakley <philipoakley@iee.org> writes:
Show 15 quoted lines
>> I suspect the question is in regards to "What branch did I create
>> my local branch from?", especially given the pull request
>> reference.
>>
>> In other words, when I locally do:
>> git checkout --no-track -b bturner-some-bugfix origin/release/5.16
>>
>> release/5.16 is the "parent branch" of my bugfix branch...
>> ...
> From the Git side, maybe one could simply populate the branch
> description with the commit oid and branched-from name at the time of
> branch creation (no doubt set as a core.option).
> The field is already there and almost never used - there's no easy way
> (via git command) to populate the description anyway. Plus its a local
> field, keeping Git distributed.
I do not think you want branch.description to get mixed-up in this.

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???

Previous: Philip OakleyNext: Bryan Turner
Message 6 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.