Skip to content

Instantly share code, notes, and snippets.

@yang-qu
Created August 24, 2016 06:42
Show Gist options
  • Select an option

  • Save yang-qu/709cb361c88d6237ec1f5cbe9b80c984 to your computer and use it in GitHub Desktop.

Select an option

Save yang-qu/709cb361c88d6237ec1f5cbe9b80c984 to your computer and use it in GitHub Desktop.
Archive changed files between two commits in a git repository
# Get changed(added or modified) files list to a text file.
git diff --name-only --diff-filter=AM <commit1>..<commit2> > changes.txt
# Create 7z archive. On windows git bash, this can also deal with file names with spaces.
7z a changes.7z -ir@"changes.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment