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

Re: Decoding git show-branch output

From
Bill Lear <rael@zopyra.com>
Date
Jan 19, 2007, 21:19 UTC
Message-ID
<17841.13791.627478.602602@lisa.zopyra.com>
In-Reply-To
<8aa486160701190613j6493daccofc259a8b17c0f1d1@mail.gmail.com>
On Friday, January 19, 2007 at 15:13:30 (+0100) Santi Béjar writes:
Show 14 quoted lines
>On 1/19/07, Bill Lear <rael@zopyra.com> wrote:
>
>[...]
>
>> I'm very confused by the syntax above.  What does "[master^2^]" mean?
>> Ditto with things like "[master~3^2^2]" and "[master~3^2~2]".
>
>They explain the relation between commits:
>
>^ -> first parent
>^n -> n-th parent
>~n -> <n>th generation parent, following only the first parent.
>
>See the manual page of git-rev-parse (or the tutorial for some simple examples).
I did.  Still don't understand.  So, following your explanation,
master~3 ^2 ~2

Means the 2nd (first generation) parent of the second parent of the 3rd (first generation) parent? Is there a way to simply state this in plain words, say in terms of commits/merges? I'm unsure how to interpret the above, especially since none of us has been developing on a branch (I see no other branch names except master, also).

I'm currently running qgit/gitk to try to figure this all out. It appears that somehow we generated way more branches than we thought we were.

Our basic work-flow for a developer is to set up one or more "private" repositories on our machines, by issuing a git-clone of our company repo.

Then we set up a "public" repo on our machine by issuing a "git --bare init-db --shared". We then push into this repo when ready, and from there other developers pull.

Then, it seems that we push to our company repository both from our private repos and our public ones, as we see fit.

I'm not sure if this is sane: is it ok to clone the company repo, then push from that clone into a bare repo, then from there to the company one? Is git doing some sort of weird, silent pseudo-merge that we don't understand, thus generated what appears to be a very tangled, albeit brief, history, when we examine it?

I have read about 8 documents on git, experimented with it extensively, and, at our company, I am arguably the "git expert"; I thought that I had done all of my work on my local repo's master branch, and only pushed from that branch up to our company repo. Yet, qgit shows that one of my first commits (to fix a few simply typos in documentation) goes off onto another branch. git-show-branch shows "[master~3^2~9] Fix a few typos" for this. I'm very confused how this could have happened, and I want to ensure we are doing things in a way that is predictable...

Thank you again.
Bill
Previous: Santi BéjarNext: Jakub Narebski
Message 3 of 5 in “Decoding git show-branch output”
  1. Bill LearJan 19, 2007
  2. Santi BéjarJan 19, 2007
  3. Bill LearJan 19, 2007
  4. Jakub NarebskiJan 19, 2007
  5. Junio C HamanoJan 19, 2007

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.