Information Technology Reference
In-Depth Information
If you want to display the contents of a
.git
directory you can use the following com-
mands:
$ cd git-recipes/02-03/
$ cd .git
$ ls -l
The last command will print the files and directories shown in
Figure 2-6
. The role
of every item is briefly described in
Table 2-2
. The complete descriptions are included
in the recipes dealing with the specific details of git.
Directory/file
Description
Directory contains scripts that can be automatically executed by git when some
events occur; for example, before each commit and after each commit.
hooks/
Directory contains a single file named
exclude
, which can be used to exclude
files from a repository. Unlike the
.gitignore
file, this file is not shared by
others.
info/
logs/
Directory contains logs of local changes made to the repository.
This is the database that contains all the information about files, directories, revi-
sions, and tags.
objects/
refs/
This is where git stores the information about branches and lightweight tags.
This is the local configuration file containing the options that will be applied to
this repository only.
config
This is the short description of the repository. It is used by the Gitweb CGI ap-
plication distributed with git.
description
The current branch or revision of the repository
HEAD
index
The staging area of the repository
packed-refs
The list of references from
refs/
in a packed format
Let's now compare the contents of three config files:
git-recipes/02-01/jquery/.git/config
git-recipes/02-03/.git/config
git-recipes/02-04/.git/config