Re: Usability issue: "Your branch is up to date"
- From
Manuel Quiñones <manuel.por.aca@gmail.com>
- Date
- Feb 4, 2025, 12:53 UTC
- Message-ID
- <CAPpV+ObaMU+WQM5gVCcY3ypPaobMtbu3dZQByOKPXyiscUBcuA@mail.gmail.com>
- In-Reply-To
- <CALnO6CB2TjwRWr0=c2nWY5DnwLeqXiaA5fCiEeF85zivmLggjA@mail.gmail.com>
El lun, 3 feb 2025 a la(s) 11:08 p.m., D. Ben Knoble (ben.knoble@gmail.com) escribió:
Show 25 quoted lines
> > On Mon, Feb 3, 2025 at 7:28 PM Bram van Oosterhout > <adriaanbram0712@gmail.com> wrote: > > > > Ahhhh, this thread explains my confusion when, even though git locally > > tells me my branch is "up to date", a fetch demonstrates the branch is > > not up to date. > > > > Which begs the question: Why does git say: "Your branch is up to date > > ..." if at best it can say: "Your > > branch MIGHT BE up to date with ..."? > > > Well, the branch _is_ up to date with your remote-tracking branch [1] > origin/main; that doesn't mean the tracking branch is up-to-date with > the repository origin's branch main! > > I find it helpful to break the notion for newcomers early on that > origin/main somehow is "equal to" the repository named by origin's > main branch. Git (mostly) only communicates with remote repos when you > fetch, push, or, pull—in other words (and this bit may be more for > Manuel), try to reinforce that things Git knows locally are only local > and not inherently tied to other repositories. Learning this > distributed lesson proves hard in my experience but explains a lot > about the reality of how Git operates.
Thanks for the advice Ben. Very good point. I will introduce the difference between the origin's main branch and the remote-tracking branch early in lessons. This is a core part of how Git works.
Still I suggest improving the usability for new generations with a timestamp of the remote-tracking branch last update. Hopefully in the future it will be possible!
-- .. manuq ..