i understand that branch is like a "sticky-note" where the commit ID is 
overwritten when user makes new commits on that branch. The basis for my 
actual question was to find the latest fork point off  the main branch, so 
that i can find if a specific commit is present on a branch (which was 
created off main).

For instance if "main" branch has a commit (ID: 4356hae), how to list out 
the branches that containing his content/commit ID?

On Tuesday, June 28, 2022 at 4:17:05 AM UTC-5 Konstantin Khomoutov wrote:

> On Mon, Jun 27, 2022 at 01:36:57PM -0700, Namasi wrote:
>
> > What is the git command to visualize the all the fork (branch) point 
> from 
> > the main/master branch? There are few branches forked from the main, so 
> i 
> > don't have the complete list. Looks for a git comment to comprehensively 
> to 
> > list/summarize the point/commits. Prefer to see in a graphview.
>
> I would say this task may be more complicated than you think.
>
> For instance, consider this history:
>
> o---o---o---m---o--- B
> / / 
> ---o---f---o---o---o---o---o--- A
>
> Here, the branch B has been forker off A at point f but then after certain
> development done on both branches A had been merged into B at point m.
> After that, the development continued.
> Does the point m represents a new fork point for B off A?
> Note that logically the point m consolidated the state of the both 
> branches.
>
> Now consider this:
>
> o---o---o o---o--- B
> / \ /
> ---o---f---o---o---m---o---x---o--- A
>
> Here, does the point f still represents a fork point of interest or not?
> It _is_ a fork point as there are three commits developed on the forked 
> line
> of history but that line has been merged back, and since branches in Git do
> not record their identity in the commits created "on" them, you cannot know
> what was the name of the branch back then when these three commits were in
> development. I mean that even if that developmend happened on a branch 
> named
> B, that information is now completely lost: there is a fork point but you
> cannot say what the name of the forked branch was.
>
> So, your question supposedly needs a more narrowly-scoped definition.
>
> If it's about finding all possible "joints" of such "diamond-shaped" bits 
> of
> the history - that's one thing. If you're only interested in the branches
> which currently exist in a repository - that's another thing.
> If you're interested only in the last point any two branches had the same
> history - that's one thing; if you want to locate the last (oldest; 
> closest to
> the root) such point - that's another thing.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/d82c6526-8dc2-43a6-b3c8-2c71a7067ef5n%40googlegroups.com.

Reply via email to