When creating a git repository that will be on the server, can I convert it to a bare repository?

mrblah picture mrblah · Nov 23, 2009 · Viewed 10k times · Source

I already created a repository. Can I make it a bare type or shall I start over?

Answer

Jørn Schou-Rode picture Jørn Schou-Rode · Nov 23, 2009

According to the FAQ, conversion from non-bare to bare can be done in two ways. The best one:

$ git clone --bare -l repo repo.git
$ rm -rf repo

To create a bare repository from scratch:

$ mkdir repo.git
$ cd repo.git
$ git --bare init