Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm pulling a bunch of company git repositories from an older host to our company git server. I started by just git clone-ing the old repos into the repositories directory on the new server. Soon we're going to point DNS for the old host to the new server.

My question is this: should I make the new repositories bare repos before this switch happens, or can they function as they are (normal, non-bare repositories with .git/ directories)? I'm guessing the former, but I'd like someone who actually knows to confirm this.

share|improve this question
up vote 2 down vote accepted

Like voretaq7 said. Yes, it is highly advisable.

In GitMagic ch3 there is a good explanation of why you want to use a bare repo.

A bare repository is so named because it has no working directory; it only contains files that are normally hidden away in the .git subdirectory. In other words, it maintains the history of a project, and never holds a snapshot of any given version.

A bare repository plays a role similar to that of the main server in a centralized version control system: the home of your project. Developers clone your project from it, and push the latest official changes to it. Typically it resides on a server that does little else but disseminate data. Development occurs in the clones, so the home repository can do without a working directory.

To make the transition easy use:

git clone --mirror

There is question on StackOverflow that discusses the the difference between git clone --mirror and git clone --bare.

share|improve this answer
Two good answers, thanks. You get the reputation for adding references and background. – pjmorse Feb 24 '12 at 0:17

You don't have to make them bare repositories, but I would strongly consider doing so for the sake of cosmetic consistency (git "servers" have a bare repo, git "clients" have a checkout with a .git directory).

If nothing else, it's less to back up.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.