Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check who pushed a Git commit

short: Is there any way to view who has pushed a commit to a git repository?

long: git log shows me who created the commits, when and what are the commit comments. So I can know an original author of a commit. If such commit was pushed to a feature branch by the original author, I'd like to check who merged this commit to the production branch.

like image 295
ducin Avatar asked Nov 26 '13 08:11

ducin


2 Answers

No, you would need an extra layer added to Git in order to record that kind of operation.
git log only display the committer and author, as recorded in the commit.
But that has no bearing on who is actually pushing said commit.

For instance, gitolite (an authorization layer) adds an audit trail mechanism, with logs.
See its log file format.

like image 51
VonC Avatar answered Oct 01 '22 18:10

VonC


You can see who has merged the branch. When you make git log --all you see all branches. There you can see the merge commits.

But the problem on Git is that you can define any author and email so you can't be sure that its correct.

If you need access control you need something like gitolite.

like image 25
René Höhle Avatar answered Oct 01 '22 17:10

René Höhle