Possible Duplicate:
How to do a “git export” (like “svn export”)
Is there a flag to pass to git
when doing a clone, say don't clone the .git
directory? If not, how about a flag to delete the .git
directory after the clone?
Possible Duplicate:
How to do a “git export” (like “svn export”)
Is there a flag to pass to git
when doing a clone, say don't clone the .git
directory? If not, how about a flag to delete the .git
directory after the clone?
Use
git clone --depth=1 --branch=master git://someserver/somerepo dirformynewrepo
rm -rf !$/.git
dirformynewrepo
not a Git repository any more.since you only want the files, you don't need to treat it as a git repo.
rsync -rlp --exclude '.git' user@host:path/to/git/repo/ .
and this only works with local path and remote ssh/rsync path, it may not work if the remote server only provides git:// or https:// access.
You can always do
git clone git://repo.org/fossproject.git && rm -rf fossproject/.git