Is it possible to clone a repository without git creating a .git folder inside the local copy of the repository? Sort of like a read only functionality?
+5
A:
You’re looking for git archive
. You either use it within a repository, or pass it the --remote=<URL>
switch, and it gives you a tarball or zip file of the source tree. You can pipe that straight back into tar
if you want to just get a pristine copy of the tree.
Aristotle Pagaltzis
2010-07-05 14:59:29
`git archive` can also create archives from remote repository. See the `--remote` option.
lunaryorn
2010-07-05 15:08:48
@lunaryorn: Sounds like you have the real answer - if you posted it, I'd certainly upvote it.
Jefromi
2010-07-05 20:27:31
@lunaryorn: That must have gotten added while I wasn’t looking. Thanks for the pointer. I’ve updated my answer.
Aristotle Pagaltzis
2010-07-06 01:18:56
+1
A:
It isn't, to the best of my knowledge.
You can git clone
and then remove .git
, but that will not be a git repository anymore -- just ordinary directory.
Also if you have access to original repository you can use git archive
there to create tarball with contents of some specific commit.
Roman Cheplyaka
2010-07-05 14:59:43