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.)
2 Answers 2
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
1 Comment
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 [email protected] 5 minutes ago
v51 Deploy de63889 [email protected] 7 minutes ago
v50 Deploy 7c35f77 [email protected] 3 hours ago
v49 Rollback to v46 [email protected] 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: [email protected]
When: 7 minutes ago
Addons: deployhooks:email, releases:advanced
Config: MY_CONFIG_VAR => 42
RACK_ENV => production