Skip to content

Instantly share code, notes, and snippets.

@GLips
Created June 19, 2014 19:02
Show Gist options
  • Save GLips/4a16a260c798a58c909d to your computer and use it in GitHub Desktop.
Save GLips/4a16a260c798a58c909d to your computer and use it in GitHub Desktop.
Automatically tar up changed files between two different commits—e.g. `mpackager HEAD HEAD^` to tar up all the files changed in the most recent commit.
#!/bin/bash
git diff $1 $2 --name-only > updates.txt
tar zcf updates.tgz --files-from=updates.txt
rm updates.txt
echo "Created file updates.tgz with the following files:"
tar -tf updates.tgz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment