Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to display the number of lines added(and deleted) to a certain file by all commits.

share|improve this question

closed as off topic by psusi, Lekensteyn, htorque, James, RolandiXor Jan 8 '12 at 23:46

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

slightly off topic isn't it. – rlemon Jan 4 '12 at 21:53
I think this question is fine. It's no more off-topic than a question about Firefox, Gedit, or unrar, isn't it? (Programmers, by the way, is the wrong site - via their FAQ: "not about [...] programming tools (ask on Stack Overflow instead)") – Stefano Palazzo Jan 5 '12 at 15:50
@StefanoPalazzo: i think you're right, i've removed my comment. – tohuwawohu Jan 5 '12 at 17:09
I closed on a whim :(... foey. I think this should be reopened. – RolandiXor Jan 8 '12 at 23:47

Use git log --numstat --oneline <Filename>. This will give you a list of commits for file <Filename>, with two lines for each commit, using this syntax:

[sha hash] [commit title line]
[lines added] [lines removed] [path to file in repository]
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.