Do a "git export" (like "svn export")? -
i've been wondering whether there "git export" solution creates copy of tree without .git repository directory. there @ least 3 methods know of:
git clonefollowed removing.gitrepository directory.git checkout-indexalludes functionality starts "just read desired tree index..." i'm not entirely sure how do.git-exportthird party scriptgit clonetemporary location followedrsync --exclude='.git'final destination.
none of these solutions strike me being satisfactory. closest 1 svn export might option 1, because both require target directory empty first. option 2 seems better, assuming can figure out means read tree index.
probably simplest way achieve git archive. if need expanded tree can this.
git archive master | tar -x -c /somewhere/else most of time need 'export' git, want compressed archive in case this.
git archive master | bzip2 >source-tree.tar.bz2 zip archive:
git archive --format zip --output /full/path/to/zipfile.zip master git archive more details, it's quite flexible.
note: if interested in exporting index, command is
git checkout-index -a -f --prefix=/destination/path/ (see greg's answer more details)
Comments
Post a Comment