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.)

asked Jan 7, 2014 at 19:55

2 Answers 2

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
answered Jan 7, 2014 at 20:11
Sign up to request clarification or add additional context in comments.

1 Comment

You are right. This won't solve my problem, but looks to be very good information. Thank you for the reply.
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 [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
answered Jan 7, 2014 at 20:13

1 Comment

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).

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.