Skip to content

Instantly share code, notes, and snippets.

@LamCiuLoeng
Forked from lxneng/gist:1003869
Created August 22, 2018 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LamCiuLoeng/eefa0261fbabff171139168d154112a7 to your computer and use it in GitHub Desktop.
Save LamCiuLoeng/eefa0261fbabff171139168d154112a7 to your computer and use it in GitHub Desktop.
How to do a “git export” (like “svn export”)

How to do a “git export” (like “svn export”)

Probably the simplest way to achieve this is with git archive. If you really need just the expanded tree you can do something like this.

git archive master | tar -x -C /somewhere/else

Most of the time that I need to 'export' something from git, I want a compressed archive in any case so I do something like this.

git archive master | bzip2 >source-tree.tar.bz2

ZIP archive:

git archive --format zip --output /full/path master 
git help archive for more details, it's quite flexible.

from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment