Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find the real user who pushed a commit in gitlab?

Tags:

gitlab

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 ?

like image 255
user2062360 Avatar asked Jun 22 '18 20:06

user2062360


2 Answers

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:

  • HTTP: nginx/gitlab_access.log

  • SSH: gitlab-shell.log

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.

like image 199
VonC Avatar answered Jan 04 '23 00:01

VonC


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

like image 39
Rajana Deepak Avatar answered Jan 03 '23 22:01

Rajana Deepak