Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check the date and time of the latest `git pull` that was executed?

Tags:

git

git-pull

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.

like image 299
Chirag Patel Avatar asked Jun 07 '10 23:06

Chirag Patel


People also ask

How do I check for git updates?

To check your Git version, open Command Prompt (Windows), Terminal (Mac), or the Linux terminal. The Git version you're currently using will be returned. Now that you know which version of Git you're using, you can decide if you want to update it or not.

When I git pull says already up-to-date?

If the current branch is not outdated compared to the one you pull from, pull will say Already up-to-date. even if you have local changes in your working directory. git pull is concerned with branches, not the working tree — it will comment on the working tree only if there are changes which interfere with the merge.

Does git pull new commit?

In the first stage of operation git pull will execute a git fetch scoped to the local branch that HEAD is pointed at. Once the content is downloaded, git pull will enter a merge workflow. A new merge commit will be-created and HEAD updated to point at the new commit.


1 Answers

stat -c %Y .git/FETCH_HEAD 

Will give you a unix timestamp of the last modification of that file. Git writes the FETCH_HEAD file every time you pull or fetch, even if there was nothing to pull.

like image 104
smoove Avatar answered Sep 20 '22 15:09

smoove