Possible Duplicate:
How to convert a git repository from normal to bare ?
I would like to make a repo into a bare repo so people can push to it with out big nasty warnings. I could delete it and clone it again... but perhaps there is a more elegant way?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With