72

I want to look at how my code base has grown over time. GitHub has a nice +/- display along the list of checkins which gives a sense of this. Is there something similar I can use with my Google Code hosted repo or offline?

Thomas Owens
  • 82,739

2 Answers2

105

There are a few options natively in Git to get data about the changes.

git log --stat will show the amount each file was changed.

git whatchanged gives some detail into the files that were modified.

git diff --stat <sha1> <sha2> gives the files and the amount of changes between two commits.

There are many other blogs that give various formatted logs. A google search can point you at these. Also doing git log --help will give the various options for formatting the history of your repo. Git has the ability to give you quite a bit of data through the various command line log options (filtering by author, file, etc).

Schleis
  • 3,396
26

If you know the commits you would like to compare, you could try using the git diff command with the --stat argument. It gives output like this:

$ git diff --stat HEAD^ HEAD
_layouts/default.html |    1 -
_sass/_variables.scss |    2 +-
_sass/main.scss       |   42 +++++++++++++++---------------------------
3 files changed, 16 insertions(+), 29 deletions(-)
  • 4
    Always love an example that works for most cases (HEAD - 1) instead of an abstraction. Thanks Mike! – SimplGy Apr 19 '16 at 22:30