Get the line of code committed in each language by a user #24510
-
In my java application, I have a use case of counting the line of code committed by each git user in each language (eg: Java - 1000 LOC, CPP 500 LOC .etc). I am planned to follow the below steps.
But performance-wise I am feeling which is a bad one. Also, Git Api allows only 5000 hits per hour for an authenticated user. Could anyone please suggest any better option for the same. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
termjobTest:
👋 welcome to the GitHub Support Community, @termjobTest ! Thanks for asking your question here. As far as I’m aware, there’s not one particular endpoint nor is there a set of endpoints beyond what you mentioned that would give you the lines of code committed (added or deleted) per user. While you could use the GitHub API to collect that information, you can obtain the same information by cloning the repository and using Here’s an example (though I imagine there are more ways that others in our community can offer input on). Clone and change directory into one of your repositories:
There’s a
It’s possible to format the output to show specific metadata, like the commit SHA, the author information, and even the files changed including how many lines were added and deleted. Here’s the documentation for each of the flags used: You could then write a script that iterates over all of the commits on a single branch (and possibly iterate through all branches) performing this command. |
Beta Was this translation helpful? Give feedback.
👋 welcome to the GitHub Support Community, @termjobTest ! Thanks for asking your question here.
As far as I’m aware, there’s not one particular endpoint nor is there a set of endpoints beyond what you mentioned that would give you the lines of code committed (added or deleted) per user. While you could use the GitHub API to collect that information, you can obtain the same information by cloning the repository and using
git
's built-in commands to compute the data that you’re looking for. …