Skip to content

Instantly share code, notes, and snippets.

@technocake
Last active October 16, 2018 11:13
Show Gist options
  • Save technocake/f2d9411d98f4f034e4a301f26462be22 to your computer and use it in GitHub Desktop.
Save technocake/f2d9411d98f4f034e4a301f26462be22 to your computer and use it in GitHub Desktop.
Copy all ignored files from a git repo
#!/bin/bash
# Copy all ignored files from a git repo to $FOLDER
FOLDER= "/path/to/folder"
for file in $(git ls-files --others -i --exclude-standard); do
cp --parents "$file" "$FOLDER"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment