Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloning a Git repo without the .git directory

Tags:

git

git-clone

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?

like image 615
TheDelChop Avatar asked Jul 05 '10 14:07

TheDelChop


1 Answers

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.

like image 137
Aristotle Pagaltzis Avatar answered Oct 10 '22 14:10

Aristotle Pagaltzis