How do I check the date and time of the latest git pull
that was executed? I frequently need to know when the code changed on a server when something goes wrong.
相关问题
- Why does recursive submodule update from github fa
- Extended message for commit via Visual Studio Code
- Emacs shell: save commit message
- Can I organize Git submodules in a flat hierarchy?
- Upload file > 25 MB on Github
相关文章
- 请教Git如何克隆本地库?
- GitHub:Enterprise post-receive hook
- Git Clone Fails: Server Certificate Verification F
- SSIS solution on GIT?
- Is there a version control system abstraction for
- ssh: Could not resolve hostname git: Name or servi
- Cannot commit changes with gitextensions
- git: retry if http request failed
As suggested by user: https://stackoverflow.com/users/83646/smoove, you can find when git pull was last called on the repo by checking the modification timestamp of: .git/FETCH_HEAD as: git writes the .git/FETCH_HEAD file every time you pull or fetch, even if there was nothing to pull.
Example: {master} vinegupt@bhling69(/imsgit_local/work/vinegupt/ims_18.5a/ims_common)$ stat -c %y .git/FETCH_HEAD
2018-02-12 02:01:50.487160386 +0530
In a non-bare repository (and a bare repository doesn't make sense for
git pull
), git logs all changes to branch tips and the current branch idea in "reflogs", in.git/logs
. You can view these usinggit log -g
.However, although the log files do have timestamps, it doesn't appear that
git log -g
will print it. However, if you take a look at.git/logs/HEAD
for example, you'll see that the format is quite simple to parse- it consists of what the ref (or HEAD) changed from, changed to, who changed it, when and an activity message.The
git show
command shows the date of the most recent commit. This isn't the date at which the commit was pulled to the local repository, but Git doesn't keep such pull information.You may be able to find the time of the last pull using the ctime (creation time) of the files on the server. For example:
shows the ctime of each file, sorted with the most recent first.