develop with

Export files from github

Archive a remote repository into a directory

Export files from github

Git doesn’t have the concept of exporting, but it does have the archive feature. The archive feature pull the data out of the repository and makes either a tar or a zip. The archive can then be expanded to a directory.

Example script for exporting the repo from a remote gitosis server:

git archive --format=tar --prefix=rake --remote=ssh://gitosis.local/rake master | tar -xf -

But the trick is that github doesn’t support the git archive command, so instead they have an svn compatible approach.

Example export of the rake repo:

svn export https://github.com/ruby/rake/trunk

For a more info on github tip, take a look at github’s archive page. This info is a summary of this stack overflow thread.

comments powered by Disqus

Want to see a topic covered? create a suggestion

Get more developer references and books in the developwith store.