2

I'm trying to find out exactly when some part of a site went live by looking at the git logs.

My setup is like this:
- I have a local git repo where I'm doing development and testing and committing changes
- I push changes to a repo on my server
- when I am happy with the changes I pull them into a second repo on the same server which makes the changes live.

So I make changes, git commit, git push. Then ssh into the web server and git pull to deploy.

Using git log I can see when I made which commits but I can't work out how to tell when I did the git pull. Is this possible?

5
  • AFAIK, git doesn't offer any functionality like that. But you can make it out using an alias and embedding some shell script to run date command and do the pull and save it in a log file. But it won't be visible when you invoke git log.
    – positron
    May 21, 2012 at 7:50
  • I'm with @positron on this. But I think a way to go would be to use git notes to annotate certain (pulled) commits.
    – kostix
    May 21, 2012 at 10:15
  • By the way, what sense is to know when exactly the pull happened? The state of the local repository depends solely on what was pulled not when it happened. Of course, "when" implies "what" to certain degree, logically, but I have no idea why you would need to know those "whens". Could you elaborate on this?
    – kostix
    May 21, 2012 at 10:17
  • It's a legal thing. I need to know as close as possible, when a certain piece of content went live. As I used a git pull to deploy, I was hoping git might be able to tell me.
    – schmicko
    May 22, 2012 at 0:28
  • You could automate the process with a post-merge hook in the live repo that logs all pulls to a separate file: schacon.github.com/git/githooks.html
    – ellotheth
    May 22, 2012 at 14:29

1 Answer 1

3

Pulls should show up in the reflog, I think: git reflog --format=fuller

1
  • 1
    Thank you. That little piece of info helped a lot. git reflog however still gives me the author and commit datetime not the pull datetime. But this info is available in the actual logs themselves as MikeSep points out here
    – schmicko
    May 22, 2012 at 1:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.