I already created a repository. Can I make it a bare type or shall I start over?
When creating a git repository that will be on the server, can I convert it to a bare repository?
10.2k Views Asked by mrblah At
3
There are 3 best solutions below
6
On
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
Just move the
.gitfolder away from the working copy.You might want to follow that up with a
in that repository, just in case
gitcomplains about something not being right.