Create a Repository Archive with git
Everything about git is amazing. And by "everything", I mean almost everything. As someone that used Perforce and SVN before learning git, I'm willing to ignore a few git annoyances since it makes branching and many other simple tasks easier.
One good problem I have with git is that it's so powerful I don't know all of its features.
One feature I recently found out about is its archive feature which allows for exporting an entire repository to a zip or tar file.
# Format: git archive {branchname} --format={compression} --output={filename}
git archive master --format=tar --output=kuma.tar
git archive some-feature-branch --format=tar --output=kuma.tar
Sure you could use any archiving utility to archive a given repo, this feature allows for quick archiving of any branch or repository state!
![7 Essential JavaScript Functions]()
I remember the early days of JavaScript where you needed a simple function for just about everything because the browser vendors implemented features differently, and not just edge features, basic features, like addEventListener
and attachEvent
. Times have changed but there are still a few functions each developer should...
![Regular Expressions for the Rest of Us]()
Sooner or later you'll run across a regular expression. With their cryptic syntax, confusing documentation and massive learning curve, most developers settle for copying and pasting them from StackOverflow and hoping they work. But what if you could decode regular expressions and harness their power? In...
![jQuery topLink Plugin]()
Last week I released a snippet of code for MooTools that allowed you to fade in and out a "to the top" link on any page. Here's how to implement that functionality using jQuery.
The XHTML
A simple link.
The CSS
A little CSS for position and style.
The jQuery...
![Create Spinning Rays with CSS3: Revisited]()
The title is misleading, git archive only puts the tree of a single commit into the .tar file, not the entire branch’s history. Useful for creating a tar file to release a version.
git bundle is what should be under this heading.
Hey, wouldn’t that make another nice entry?
Just a small correction:
--format
does not mean compression. It is – well – just the format of the archive, but it is not compressed at all.