It's probably best to just delete and clone again. Example:
mv old_git_repo/ /tmp/
git clone --bare /tmp/old_git_repo/ new_git_repo/
You could also just remove the working files and promote .git/*
to .
. However, you'd also need to add bare = true
and remove logallrefupdates = true
in the new bare config
's [core]
section (formerly .git/config
. You could make a script to do this automatically if you like.
Edit: You mentioned in a comment that this was cloned from svn, so a new clone will take a long time. But - don't clone from svn! Just clone from the new git repo, and it will be git -> git
, which will be fast. Or, see my note above about just moving the files.