如何查看上次git pull的时间? [英] How can I see the time of my last git pull?

查看:806
本文介绍了如何查看上次git pull的时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个git pull,但现在想知道发生在什么时间.有没有一种检查拉动时间的方法?请注意,当我拉动时,没有任何变化.但是,也许记录了SSH连接?我想在我的本地机器上而不是在服务器上检查它.使用Linux,git版本2.3.3.

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.

推荐答案

即使您没有要拉的内容,Git也会在每次拉取或抓取时写入FETCH_HEAD文件.可以在以下位置找到该文件:.git/FETCH_HEAD.只需检查该文件的最后修改时间即可.

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.

在Linux中,您可以使用以下命令检查上次修改时间:

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

date +%s -r .git/FETCH_HEAD

在OSX上,您可以执行以下操作以获取上次修改时间:

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

stat -f "%m" .git/FETCH_HEAD

这篇关于如何查看上次git pull的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆