I want to track all commits pushed from specific pc. Commits may contain different user name as different person work with the pc. Can anyone know how to list all commits pushed from single pc.
Asked
Active
Viewed 338 times
2
-
I hope following link may help you. https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History – Naveen.sn Sep 28 '15 at 08:00
-
Thanks for your reply, here i mentioned that i want to know about specific pc as there might be chances that some one else have done commits from pc with different user name( as password was common in team ). – Keyur Patel Sep 28 '15 at 08:05
-
Have you tried below command? git log --author="username" – Naveen.sn Sep 28 '15 at 09:03
-
@Koushik, what if i want to know how many commits have been made from my pc using my account. – Keyur Patel Sep 29 '15 at 05:03
-
`git` does not track the origin of commits, so there is no information in `git` about which machine a specific commit was originally authored/committed on. Unless you require some sort of metadata in commit messages or track the information somewhere else, this will not be possible. – twalberg Sep 29 '15 at 17:16
2 Answers
0
You would need some kind of audit logs, which is not provided by native git.
If your git server has gitolite, you would have the ip of each client logged in .gitolite/logs
.

VonC
- 1,262,500
- 529
- 4,410
- 5,250
-
Thanks it will be very useful for future reference. I want it for current system, as there isn't any such module installed right now, it would be difficult to list all the data which gitolite provides. Do you have any other suggestion. – Keyur Patel Sep 28 '15 at 08:16
-
@KeyurPatel what is your current git server? How does it listen for git queries like clone/push/pull? Is it an Apache server? An sshd? A shared filesystem? – VonC Sep 28 '15 at 08:18
-
git has been installed on github, we used to pull/push/clone using linux based local system.We are using apache in local machine and nginx on live server. I want to trace local system not the live environment so it doesn't matter its a shared system or sshd. Waiting for your response. – Keyur Patel Sep 28 '15 at 08:39
-
@KeyurPatel I mean: are you pushing to a private git hosting server that you control, and if yes, how that private git hosting server is listening to your push queries? – VonC Sep 28 '15 at 08:45
-
Yes its a private repository and it listens pull/pushes from authenticated users authorized with email id. Also we are using https based authentication (using https url not ssh) to push/pull request to git server. – Keyur Patel Sep 28 '15 at 08:57
-
@KeyurPatel ok, so you have an Apache server which calls git through git-http-backend (as illustrated in http://stackoverflow.com/a/3248848/6309). Nothing prevents you to make that server calls another script, which in turn will call git-http-backend. That is what gitolite does: http://stackoverflow.com/a/14105149/6309 or http://stackoverflow.com/a/21276320/6309, but you can adapt that to call a script which would log the ip on push. – VonC Sep 28 '15 at 09:08