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

Re: File missing from git branch

From
PPPrasad Pandit <pjp@fedoraproject.org>
Date
Jan 3, 2025, 10:26 UTC
Message-ID
<394850972.5946685.1735899970546@mail.yahoo.com>
In-Reply-To
<CAPx1GvdmrTn0x-F8yOoGrSrhXPN6At54svch=Wf=9rcz9Ri=7Q@mail.gmail.com>
Hello Chris,
* Thank you for the elaborate reply, I appreciate it.
On Thursday 2 January, 2025 at 05:10:26 pm IST, Chris Torek <chris.torek@gmail.com> wrote: 
Show 6 quoted lines
>Git is different.  A branch is -- depending on your point of
>view -- simply a *temporary name* for *one particular commit*.
>From another point of view, it is *that commit and every
>commit reachable by working backwards from that commit's
>history*.
>
...
>One of these metadata items is a list of raw hash IDs of
>*previous* commits, usually exactly one entry long.
>We call that hash ID the parent, or parents if it's
>longer than one entry, of the commit.
* The parent-child connection between commits is fairly convoluted and unintuitive to understand. Especially when user does not even see the parent of non-merge commits easily. For merge commits git-log(1) shows parents.
* In my case what seems to happen is, the commits pulled from upstream repository come with their own parent commits and my local commits in the 'main' branch are not merged with them OR those pulled commits are not linked with the local commits history. Something like say
   main-branch -> uc1 ... ucN    <= forked and upstream repository are same.
We add local commits to it
   main-branch -> lc1 -> lc2 -> uc1 ... ucN
Here lc1 and lc2 are local commits and uc1 onward are upstream commits. After $ git pull from upstream repository maybe it changes to
                                     lc1 -> lc2
                                    /          \
   main-branch -> uc1 -> uc2 -> [mc] ->  -  -  -> uc3 ... ucN  (<= earlier uc1 becomes uc3 here)
* I wonder if there's a way to merge those histories with git pull(1) as
   main-branch -> uc1 -> uc2 -> lc1 -> lc2 -> uc3 ... ucN
And whether that wouldn't create new issues of it's own. I guess the diversion comes because of the merge commits '[mc]', which essentially creates two paths to traverse history. And as the number of merge commits '[mc]' increase, number of paths also increase.
Thank you.
---
  -Prasad
Previous: Chris Torek
Message 5 of 5 in “File missing from git branch”
  1. Prasad PanditDec 31, 2024
  2. Junio C HamanoJan 1, 2025
  3. Prasad PanditJan 2, 2025
  4. Chris TorekJan 2, 2025
  5. Prasad PanditJan 3, 2025

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.