3

Is there a way to show when a particular commit was pushed into a remote repo? In other words, I know who made a change (and when it was committed), but I don't know when it was pushed to my production environment in heroku (note: heroku just uses a git push to deploy)

Ideally, it would be something like:

$ git remote myprodrepo show 201421b78ae73a21bc6045a78b4b5db5c54697e7

and I could see when that commit actually got pushed into that repo.

note: the syntax above does not work, and is only there in an attempt to sort of show what I'm trying to accomplish.

(I hope this question makes sense - please ask questions if it doesn't.)

David S
  • 12,967
  • 12
  • 55
  • 93

2 Answers2

1

No, Git don't record any log for those operations.

An intermediate authorization layer like Gitolite can keep such a record, but that may not be a good fit with your current setup.

Bside heroku releases suggested by Chris, the one pure git way to get a recent record of all those operations (not just push) is suggested here, in the config of your remote git repo:

# required for a bare repo
git config core.logAllRefUpdates true

git reflog --date=local master
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • You are right. This won't solve my problem, but looks to be very good information. Thank you for the reply. – David S Jan 07 '14 at 22:01
1

VonC is correct that Git itself does not track this information, but on Heroku, you should be able to get this information using the heroku releases command.

Sample output from the linked page:

Rel   Change                          By                    When
v52   Config add AWS_S3_KEY           jim@example.com       5 minutes ago
v51   Deploy de63889                  stephan@example.com   7 minutes ago
v50   Deploy 7c35f77                  stephan@example.com   3 hours ago
v49   Rollback to v46                 joe@example.com       2010-09-12 15:32:17 -0700

Note that v51 shows when de63889 was deployed to Heroku.

You can then use, e.g., heroku releases:info v51 to get detailed information on this release:

=== Release v51
Change:      Deploy de63889
By:          jim@example.com
When:        7 minutes ago
Addons:      deployhooks:email, releases:advanced
Config:      MY_CONFIG_VAR => 42
             RACK_ENV      => production
Community
  • 1
  • 1
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • Thank you for your reply. Yes; I do know this is available, but it's with branches, etc it can be a little bit hard to tell when a commit actually ended up in production. In other words, a release might be made up of 20+ commits before it is pushed (it might have been the 9th in the series that had the bug). – David S Jan 07 '14 at 22:00