Clone bare git

Found an interesting option to clone a git repository. Honestly, speaking I have no idea how it could be usefult because it does not actually do a checkout of the HEAD. Anyways, if you run:

git clone --bare git://github.com/andhapp/decoct.git

then you will have the following directory structure which is quite similar to what’s in your project’s .git folder.

-- decoct.git
   -- HEAD
   -- config
   -- description
   -- hooks
   -- info
   -- objects
   -- packed-refs
   -- refs

This is what the doc has to say:
–bare : Make a bare GIT repository. That is, instead of creating and placing the administrative files in /.git, make the itself the $GIT_DIR. This obviously implies the -n because there is nowhere to check out the working tree. Also the branch heads at the remote are copied directly to corresponding local branch heads, without mapping them to refs/remotes/origin/. When this option is used, neither remote-tracking branches nor the related configuration variables are created.

This is exacly what it does but how would this be useful puzzles me.

About andhapp

Namastey (Hello) Stranger, This is not the geekiest blog on the planet yet it is not the dumbest one either. I am a small time developer who likes to explore new technologies. I usually program in Java, Groovy and Ruby and take keen interest in the surrounding geeky developments.
This entry was posted in Git and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>