Information Technology Reference
In-Depth Information
Hint This is the approximate measure that I use to declare the number of days I
work on a book. When the command $ git log --pretty=format:%cd --
date=short | uniq | wc -l returns 95 it means that I worked on a book not
more than 95 days.
The next two questions concern the amount of space that the working directory and
the git directory contain. The amount of space the git directory contains is returned by
the command:
$ du -h -s .git
The amount of space the working directory contains is printed by the command:
$ du -h -s --exclude=.git
Here are the results for the jQuery project:
The working directory: 1.3 MB
The git directory: 16 MB
As you can see the git directory uses much more space than the working directory.
This is not surprising: the database stored in .git/objects contains 5,192 revi-
sions. Every revision can be thought of as a snapshot of a complete working directory.
The last question can be answered with the git ls-files command:
$ git ls-files | wc -l
The git ls-files command prints the names of all the files in the working directory.
We use wc -l to count them.
2-10. Defining aliases for the commands
discussed in Recipes 2-8 and 2-9
Problem
Search WWH ::




Custom Search