Skip to content
- When a git repository is initiated i.e (git init) a directory is created called (.git).
- .git directory contains all the necessary file git stores and manipulate.
- If you want to backup or clone a repository, copying the .git directory will do the job.
- Below is the files and directories inside .git folder
- branch directory
- config file
- description file
- HEAD
- hooks directory
- info directory
- objects directory
- refs directory
- index file (if data exist in staging area)
- You can see other files as well with in this directory but above mentioned files and directories are created when your git repository is initialised.
- description directory is used by git web program.
- config file contains project specific configuration.
- info directory keeps a global excluded file for ignoring pattern that you don’t want to track in .gitignore file.
- hooks directory contains client or server side hook scripts.
- object directory stores all the content of your repository.
- refs directory stores pointer to the commit objects.
- HEAD file points to the currently checked out branch.
- index file is where GIT staging information is stored.