How can I convert a 'normal' Git repository to a bare one?
The main difference seems to be:
in the normal Git repository, you have a
.git
folder inside the repository containing all relevant data and all other files making up your working copyin a bare Git repository, there is no working copy and the folder (let's call it
repo.git
) contains the actual repository data
In short: replace the contents of
repo
with the contents ofrepo/.git
, then tell the repository that it is now a bare repository.To do this, execute the following commands:
Note that this is different from doing a
git clone --bare /path/to/repo
to a new location (as described here).Consider this scenario
If that's your intention, that's fine. If you needed a mirror of the remote/origin, this is not the way.