JoeB
JoeB

Reputation: 1618

Report who is doing a pull/checkout/fetch on my git repo

How do I know who is pulling from my git repo? Or doing a git fetch origin? Obviously I can look at git log to see the pushes/commits, but is there any way to see if people are just pulling my code to read it or stay synched up?

Here is some context. First off, the closest match on stackoverflow I could find was Track git pushes and checkout but the question didn't satisfactorily get resolved. I decided to pull this into a different question because it is slightly different...

The environment is git repository server that is acting as a central repo that developers are cloning from and pushing changes back into. The central repo is the one that gets built in continuous integration and releases are done from that code base.

I have a variety of user management tools: gerrit, gitosis, and gitolite.

Why would I want to know this and why would it be relevant to you too? In my case I want to know who's working on what...who's looking at what. That info can help decide what projects are no longer maintained/interesting and can possibly be shelved. It can also help create ugly managerial metrics (not a fan of this really, but it is a necessity in the business) of who is active. Git log will show who's committing code, which is more telling on productivity, but not if people are not pushing frequently. I really cant think of any other use cases, but those are my two.

So...any way to pull that info from git directly? I remember CVS history would give some of that, but I cant figure it out in git. If not git directly, what about gerrit, gitosis, or gitolite?

Thanks.

Upvotes: 0

Views: 149

Answers (1)

Jeff Ferland
Jeff Ferland

Reputation: 18312

The first toolset I would look to for solving such a task would be to try using Git + WebDAV on Apache. With authentication and access logs, that may provide you the information you're looking for. That failing, you may be in the position to write a custom Git server. As Git was designed to be decentralized, and clients can operate without ever talking to your chosen server, I believe the functionality for tracking retrievals isn't part of the core.

Upvotes: 1

Related Questions