Git Internals (2/4)
Empty Repository

Empty Repository

We will start with an empty repository to illustrate the internal structure of a Git repository.

We create a new repository by creating a new directory called "EmptyGitRepo1" and executing git init inside it.

After executing the git init command a new directory called ".git" is created. The contents of the .git directory are shown in Figure 1.

Initial contents of .git directory
Figure 1: Initial contents of .git directory

The "config" file contains repository configurations options. The initial contents of the file are shown below.

File: EmptyGitRepo1/.git/config

	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	symlinks = false
	ignorecase = true
	hideDotFiles = dotGitOnly

The "description" file is simply a file whose contents give a description of the repository. It can be used by tools (the web interfaces for instances) to show a human-friendly description of the repository. It doesn't affect repository operations in any way. The initial contents of the file are shown below for reference.

File: EmptyGitRepo1/.git/description

Unnamed repository; edit this file 'description' to name the repository.

File: EmptyGitRepo1/.git/HEAD

ref: refs/heads/master

blog comments powered by Disqus

Copyright(c) 2006-2015 Xavier Leclercq | Privacy policy

Contact Us