In short: replace the contents of repo
with the contents of repo/.git
, then tell the repository that it is now a bare repository.
To do this, execute the following commands:
cd repo
mv .git ../repo.git # renaming just for clarity
cd ..
rm -fr repo
cd repo.git
git config --bool core.bare true
Note that this is different from doing a git clone --bare
to a new location (see below).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…