Show HN: Apply .gitignore files to Time Machine backups
1–4 of 4 posts
Re: Show HN: Apply .gitignore files to Time Machine backups
#2Re: Show HN: Apply .gitignore files to Time Machine backups
#3This is dangerous. This will suppress the backup of files that were added to the repo with a manual override, against .gitignore rules.
If I understand you correctly, you mean files that are matched by rules in a .gitignore but staged using the -f option and then committed. The command this script uses to obtain the list of files to exclude is:
git ls-files --directory --exclude-standard --ignored --others
A file staged and committed as described above is not listed using that command, and therefore not excluded from backups.Re: Show HN: Apply .gitignore files to Time Machine backups
#4This is dangerous. This will suppress the backup of files that were added to the repo with a manual override, against .gitignore rules.
I don't think that's true. If I understand you correctly, you mean files that are matched by rules in a .gitignore but staged using the -f option and then committed. The command this script uses to obtain the list of files to exclude is: git ls-files --directory --exclude-standard --ignored --others A file staged and committed as described above is not listed using that command, and therefore not excluded from backup…
Though it's not really just .gitignore anymore. Plus it depends on git and its performance... I'm just thinking of really large repos. This approach would basically mean that the tree is scanned twice.