Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see the time of my last git pull?

Tags:

git

I did a git pull but now want to know at what time that happened. Is there a way of checking the time of a pull? Note that NO changes came in when I did the pull. But perhaps the SSH connection is logged? I want to check this on my local machine rather than on the server. Using Linux, git version 2.3.3.

like image 610
User402841 Avatar asked Mar 17 '15 04:03

User402841


People also ask

How do I view commit history?

On GitHub.com, you can access your project history by selecting the commit button from the code tab on your project. Locally, you can use git log . The git log command enables you to display a list of all of the commits on your current branch. By default, the git log command presents a lot of information all at once.

Should you git pull every day?

Pull frequently You should endeavor to keep your local machine as close to the remote repository as possible. The way to do that is to pull all the changes on the remote server to your local copy. You can do this as often as you like, and should do it frequently — at least once a day if not more.

How do I see last commit in git bash?

Viewing a list of the latest commits. If you want to see what's happened recently in your project, you can use git log . This command will output a list of the latest commits in chronological order, with the latest commit first.


1 Answers

Git writes the FETCH_HEAD file every time you pull or fetch, even if there was nothing to pull. The file can be found at: .git/FETCH_HEAD. Just check the last modification time of that file.

In Linux you can use the following to check the last modified time:

date +%s -r .git/FETCH_HEAD

On OSX you can do the following to get the last modified time:

stat -f "%m" .git/FETCH_HEAD
like image 78
fijas Avatar answered Sep 22 '22 05:09

fijas