
Show HN: Apply .gitignore files to Time Machine backups - baleb
https://github.com/samuelmeuli/time-machine-ignore
======
eps
This is dangerous. This will suppress the backup of files that were added to
the repo with a manual override, against .gitignore rules.

~~~
baleb
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 backups.

~~~
eps
I couldn't get the .py source load on mobile, so I went by the post title. If
it goes through ls-files, then it should be fine.

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.

