Bare Repositories

Goals

  • Learn how to create bare repositories.

Bare repositories (without working directories) are usually used for sharing.

Create a bare repository.

Execute:

  1. cd ..
  2. git clone --bare hello hello.git
  3. ls hello.git

NOTE: Now in the work directory

Output:

  1. $ git clone --bare hello hello.git
  2. Cloning into bare repository 'hello.git'...
  3. done.
  4. $ ls hello.git
  5. HEAD
  6. config
  7. description
  8. hooks
  9. info
  10. objects
  11. packed-refs
  12. refs

The convention is that repositories ending in ‘.git’ are bare repositories. We can see that there is no working directory in the hello.git repo. Essentially it is nothing but the .git directory of a non-bare repo.