We have a "central" repo that we use to deploy to our development server. I know git log
will show me commits and the date/time they were committed, but I'd like to see when commits were pushed to/received by the repo. Any way to do this?
Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.
What does git log do? The git log command displays all of the commits in a repository's history. By default, the command displays each commit's: Secure Hash Algorithm (SHA)
The Git Show command allows us to view files as they existed in a previous state. The version can be a commit ID, tag, or even a branch name. The file must be the path to a file. For example, the following would output a contents of a file named internal/example/module.go file from a tagged commit called “release-23”.
Git’s reflogs will record your specified data (date, and new tip commit).
If your central repository is bare, then its reflogs are probably not enabled (they are not enabled by default when creating a bare repository). Enable them like this:
git config core.logAllRefUpdates true
You should also consider reviewing the other configuration options related to the reflogs (see git-config(1) and search for “reflog”): gc.reflogexpire, gc.reflogexpireunreachable.
You may also want to enable receive.denyDeletes (since a reflog is deleted when its branch is deleted). If you are only concerned with preserving the reflogs on certain branches then you could implement your own pre-branch “deny delete” with a receive or update hook (see githooks(5)).
Once you have enabled the reflogs you can review their contents with eithergit reflog show branch-name
orgit log -g branch-name
(either may be combined with other git log options).
This will still not include other information that you may want (like who was pushing the new tip*), but it might help.
*
The problem is that the authentication system (SSH, SSH+gitolite, HTTP, HTTP+git-http-backend
, etc.) does not usually pass this information down to the level that records the new reflog entry; I recall that some organization (Gentoo?) was exploring something that would help record this information (as they are/were considering migrating to Git), but I do not recall the details).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With