Git does not store the pull time anywhere for you, but it leaves traces on your file system. Among other things, git pull
will change the files in .git/refs/remotes/origin
.
If you look at
ls -la .git/refs/remotes/origin
each file there corresponds to a remote-tracking branch, and each file is most likely dated as of the last time it was changed through a pull, or a fetch. Or a push, too.
The most recent of the files in there is most likely dated the time when you last ran git pull
or git fetch
.
For example, I have an old sandbox on my computer:
$ ls -la .git/refs/remotes/origin/
-rw-r--r-- 1 me 32 Apr 13 2022 HEAD
-rw-r--r-- 1 me 41 Oct 22 15:02 ignore-revs
-rw-r--r-- 1 me 41 Oct 22 14:41 master
-rw-r--r-- 1 me 41 Oct 22 14:41 test-build
This tells me that I first cloned the repo into that sandbox on April 13, last fetched master
and test-build
on Oct 22 at 14:41, but now I can't say if fetched ignore-revs
at 15:02 or if I pushed it from this sandbox.