7

Is there a way to find out who pushed a particular commit to gitlab - In the commit log (I see the author set via the git client config) , I instead want to see which gitlab user's authentication was used to PUSH that code ?

PS: There are multiple git specific questions asked and there was no solution provided in the previous questions - want to see if gitlab has some specific implementation to solve this ?

user2062360
  • 1,323
  • 5
  • 16
  • 29
  • Possible duplicate of [Check who pushed a Git commit](https://stackoverflow.com/questions/20212329/check-who-pushed-a-git-commit) – Rajana Deepak Jun 23 '18 at 05:06
  • I wish there was a way to get "pusher" using GItLab API. It's definitely stored somewhere in the db, but doesn't seem to be available via API: https://docs.gitlab.com/ce/api/commits.html#get-a-single-commit – Ivan Jul 17 '18 at 17:31

3 Answers3

6

2018: I answered "no" 5 years ago, but GitLab offers audit logs of its own: As mentioned here HTTP and SSH requests are logged in different files:

However, that won't give you the SHA1(s) pushed, only the push event date and IP: you still need to cross-reference that with a commit date, to get an idea of who did push a given commit.


GitLab 14.9 (March 2022) seems to include push events (but for Premium/Ultimate editions only):

New audit events

The GitLab 14.9 release adds support for auditing the following activities:

  • Creating a new merge request approval rule.
  • Deleting a merge request approval rule.
  • Approving a merge request. (Supported as streaming audit events only.)
  • Creating, deleting, or revoking a project or group deploy token.
  • Failed attempts to create a project or group deploy token.
  • Authenticated git push or git pull commands to a private repository performed over either SSH or HTTPS (Supported as streaming audit events only.)

See Documentation and Issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

Only commit status can be known. But person who actually pushed cannot be known.

Rajana Deepak
  • 1,302
  • 2
  • 13
  • 28
-2

because of the confusing nature of your question, I am only able to provide simple answers. If what you are asking is to see what authentication a particular user has used to PUSH a commit then you should be able to find it based on the remote URL for the repo. If you are looking to find out who did a specific commit, you can search for it in the Web UI.

Hope this helps, reach out if you have additional questions.