0

I found there is only way to see the last git pull, which is the most current one I already done, I want to know the one that I did prior to the one I did most recently. Because I want to reverse my repo to that specific version at the date when I pulled it and the most recent pull I did is messed up. So in summary, the timestamp of the one BEFORE my latest git pull is what I need.

The repo is bitbucket based git repo.

Is there way to do that at all?

ey dee ey em
  • 7,991
  • 14
  • 65
  • 121

3 Answers3

3

git reflog --date=iso

output:

2b88250 HEAD@{2016-12-02 01:22:55 +0200}: pull ssh://localhost:29418/test-project refs/changes/07/7/1: Fast-forward
b49719d HEAD@{2016-12-02 01:20:46 +0200}: pull ssh://localhost:29418/test-project refs/changes/06/6/1: Fast-forward
1f384f6 HEAD@{2016-12-02 01:19:06 +0200}: clone: from ssh://localhost:29418/test-project
Filip Stefanov
  • 800
  • 3
  • 10
  • 18
0

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

This answer has different ways to find the last time a file was edited.

Since you used the osx tag, this will allow you to see the last time that you ran git pull:

stat -f '%m' .git/FETCH_HEAD

Should print out the time stamp of the last time that FETCH_HEAD was edited, which was the last time you ran git pull or git fetch.

Sadly, I do not think it is possible to do what you are asking. You can find the last access, last change, last modified, and the creation time of a file using stat, but I don't think finding the history of "last modified" is possible.

Community
  • 1
  • 1
tehp
  • 5,018
  • 1
  • 24
  • 31
0

For your current branch you can get the dates for all git pull commands you ran by doing the following:

$ for i in $(cat .git/logs/refs/heads/<YOUR_BRANCH_NAME_HERE> | grep pull | awk '{print $5}');do date -d@$i; done

Note: The awk arg may change depending on git version. This awk arg works for git version 1.8.3.1.

ssharma
  • 150
  • 1
  • 4