What you know is that this command creates a new subdirectory named .git
, which is the source of versioning. Let's move one step further and explore the contents of the .git
directory, which should have a directory structure as shown in the following screenshot:
Hooks are customization scripts that can be injected into various Git commands and its operations. It is possible to write our own hook and such a hook has to go into this directory.
There are a bunch of sample hooks automatically created inside this directory as part of git init
but not activated until we manually rename hook_name.sample
to hook_name
. To learn more about the various hooks present in the directory open up the help document by typing git help hooks
in your command line.