Skip to content

Instantly share code, notes, and snippets.

@joshbtn
Last active August 29, 2015 14:09
Show Gist options
  • Save joshbtn/1c855397421b48a7570d to your computer and use it in GitHub Desktop.
Save joshbtn/1c855397421b48a7570d to your computer and use it in GitHub Desktop.
Git - grab files from diff
#!/bin/bash
branch=$1
output=$2
(IFS=$'\n'; git archive -o $output $branch $(git diff @{0} $branch --name-only --diff-filter=ACM))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment