Skip to content

Instantly share code, notes, and snippets.

@davidpark-blade
Last active January 30, 2023 19:52
Show Gist options
  • Save davidpark-blade/9f9e1c9839f56e17f4173440753f90fc to your computer and use it in GitHub Desktop.
Save davidpark-blade/9f9e1c9839f56e17f4173440753f90fc to your computer and use it in GitHub Desktop.
git archive --format=zip HEAD `git diff HEAD~1..HEAD --name-only --diff-filter=d | grep -E 'config/locales/.+\.yml|frontend/translations/.+\.js'` > files-changed-to-translate.zip
// change 1 to number of commits in pr
@mrtnzlml
Copy link

@davidpark-blade Might be worth adding --diff-filter=d to skip deleted files like so:

git archive --format=zip HEAD `git diff HEAD~1..HEAD --name-only --diff-filter=d | grep -E 'config/locales/.+\.yml|frontend/translations/.+\.js'` > files-changed-to-translate.zip

See: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203

@davidpark-blade
Copy link
Author

@davidpark-blade Might be worth adding --diff-filter=d to skip deleted files like so:

git archive --format=zip HEAD `git diff HEAD~1..HEAD --name-only --diff-filter=d | grep -E 'config/locales/.+\.yml|frontend/translations/.+\.js'` > files-changed-to-translate.zip

See: https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment