To simplify and combine the information in the answers:
There are three differences that make a bare repo different from a normal .git folder:
- core.bare is set to true in config file
- index file and working tree do not in exist
- a default refspec for the "origin" remote is not generated
So, you can simply move your bare repo to be the .git subfolder of a new folder,
mkdir clone
mv bare.git clone/.git
Change core.bare:
cd clone
git config --local --bool core.bare false
Add a default origin refspec to make git fetch
and git push
pick the same defaults as usual:
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
And generate the index file and working tree:
git checkout master
I recommend git checkout
rather than git reset
to generate the files, in case it is accidentally typed into the wrong place.
.git
directory and set thebare
parameter in the config to false, it should behave like a regular repository where you can justgit checkout
to get your files. – Cajungit show
andgit cat-file
– Steelwork