9 ms·
Nice. But technically its true. origin/master is not master on origin. It just refers to the last known commit pointed to by origin/master, which gets updated w
by Lutger 3y ago
Nice. But technically its true. origin/master is not master on origin. It just refers to the last known commit pointed to by origin/master, which gets updated when you fetch (pull automatically fetches).
ls -l .git/refs/remotes/origin/master
origin/master is just a file on your system, you can see when it has been changed. It doesn't magically get updated. Do `git fetch origin` and if there are any changes, you'll see the timestamp change, and the contents:
cat .git/refs/remotes/origin/master
The basics of git are so simple, you can implement the core data structures and some operations in a day. It is really worth it to get to know these.
Somehow git has managed to create a very complex user interface on top of quite a simple core.
- cush 3y ago> It just refers to the last known commit pointed to by origin/master The confusion lies in that origin refers to different things depending on if it's `origin master` or `origin/master`. Eg `git pull origin master` does the thing we expect
- metabagel 3y ago> The confusion lies in that origin refers to different things depending on if it's `origin master` or `origin/master`. Git is not well designed for human beings.
- Y-bar 3y ago> But technically its true. Is it though? Consider a bank telling a store I am buying things at "This person has has €450 in their bank account", when at that moment I have €310. The store would be rightfully pissed at the bank for effectively lying when it is made clear later on that the transaction could not be completed and the bank answers "well, the person had €450 a few days prior to you asking us". Without an explicit temporal information it is explicitly now. Without an explicit status on sync status it is implicitly saying sync is up-to-date. It's a lie of omission.
- fernandotakai 3y ago>It's a lie of omission. but it's not? if you have an old bank receipt that says you have $450 in your account, but you actually have $310, you need to "get" a new receipt that has the newest value. you do that by issuing git fetch origin. then you can git merge origin/master to make everything up-to-date.
- Y-bar 3y agoBank receipts always have a date and time, that's _exactly_ the point I am making, the omission is part of the lie.
- fernandotakai 3y agoyou are getting confused here. what you have is a "paper receipt" (your checked out version) from your bank. something that, if you need an up-to-date version (from another remote), you need to request a new one (by issuing git fetch). git is, by default, distributed, so whenever you need to see the world outside, you need to be explicit. linus made it this way because back in the day (not sure right now tbf) tons of kernel developers do work without any internet connection, and would only connect to pull/send patches. this talk[0] by linus from 2007 (i remember watching it on google videos lol) explains really well where the git mentality came from. i really recommend it to you, since it feels like you are not really getting how git works. [0]https://www.youtube.com/watch?v=4XpnKHJAok8 https://www.youtube.com/watch?v=4XpnKHJAok8
- SAI_Peregrinus 3y agoIf you have a paper recipt (git status) it tells you when it was up to date, so you can determine whether you need a new one. Git doesn't provide that info. That's the problem, not that it can be outdated, but that it omits the date/time!
- metabagel 3y agoIt’s a little offensive to tell another person that they are confused. If they are confused, they can say so.
- cesarb 3y ago> origin/master is just a file on your system Unless it's a packed ref (https://git-scm.com/docs/git-pack-refs https://git-scm.com/docs/git-pack-refs), in which case it's just a line in the packed-refs file.
- emmelaich 3y agoIt's sort of misleading because origin is not the origin, it's your copy of the origin. You have to fetch to make it the same. I can't suggest a better name, but you have to admit the word 'origin' suggests the origin, not some partial copy of it. It's not a biggy, it's just one of the little toe-stubs and paper cuts you get over pretty quickly.