Tuesday, March 15, 2016

Convert git --bare to normal

I was making a bunch of --bare repos for interpreted codes.  I started working in compiled languages and found it nicer to have the compiled program easily available so my coworkers can just copy and run it rather than cloning and compiling themselves.  I wanted to convert the --bare to normal repos.  Enter stack exchange!


I'm reposting here because you have to read the answer and the comments to get it all working.

Make a .git folder in the top-level of your repository.
Move the all the repo folders into the .git folder (HEAD branches config description hooks info objects refs) into the .git you just created.
Run git config --local --bool core.bare false to convert the local git-repository to non-bare (might need sudo)
run git checkout master (this one was found in the comments)

No comments: