Tuesday, March 1, 2011

git bare repos

Our files: Files and directories that we have created and which contain our data. These files and directories are collectively known as working tree.

.git directory: This folder contains all of the Git's control files.

A bare git repository does not have working tree and it also does not have .git directory either. All of the Git's control and management files are present in the directory directly. You can not checkout from a bare repository or commit to it.

So what are they useful for when you cant checkout or commit to them?

Bare Git repos are good for pushing and pulling only and they are designed this way so that they can be used as common shared repo by a group of people. So any one want to make changes makes a clone of that bare repo, makes changes in that cloned repo, commit them there and then push the changes to bare repo. Now any one wanting those changes can pull them from the bare repo.