Information Technology Reference
In-Depth Information
Listing 2-8.
The command that prints the number of commits in the repository
$ git log --pretty=oneline | wc -l
Listing 2-9.
The command that prints the number of contributors
$ git shortlog -s | wc -l
Listing 2-10.
The command that produces the number of days during which contribu-
tions were made
$ git log --pretty=format:%cd --date=short | uniq | wc -l
Listing 2-11.
The command that returns the amount of space used by the git directory
$ du -h -s .git
Listing 2-12.
The command that returns the amount of space used by the working dir-
ectory
$ du -h -s --exclude=.git
Listing 2-13.
The command that produces the number of files in the working directory
$ git ls-files | wc -l
Hint
Linux and Windows version of
du
both support
--exclude
parameter. But
some other systems, such as BSD, use other options. In BSD, exclusions are set with
-I
option (
I
stands for Ignore).
How It Works
The answers to the above questions can be found using the following commands: