Created
April 30, 2016 14:46
-
-
Save p404/af733e2ac48fa3f0b2b69403ee4a7200 to your computer and use it in GitHub Desktop.
Bash script that recollect all files ignored in a git project by the .gitignore file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Git ignore backup script | |
function compress() { | |
files=$(grep -v '^\s*#' < .gitignore) | |
env GZIP=-9 tar cvzf $1.tar.gz $files 2> ignore_backups_errors.txt | |
exit 0 | |
} | |
if [[ -z "$1" ]]; then | |
compress backup_ignore | |
else | |
compress $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment