HN user

mbudde

63 karma
Posts0
Comments22
View on HN
No posts found.
    git ls-files --others --ignored --exclude-standard
Or if you want to see files ignored by a specific .gitignore:
    git ls-files --others --ignored --exclude-file=<file>
There's also
    git status --ignored
if you just want a quick view of the ignored files (i.e. not for scripting).

I have very similar setup to yours, but my solution is to use a bare repository. To set up dotfiles on a new computer is just

    $ git clone --bare git@github.com:mbudde/homedir.git .homegit
    $ git --git-dir=.homegit --work-tree=~ checkout -f    # Overwrite existing files
    $ echo '*' >> .homegit/info/exclude
And then I have a simple git wrapper script [1]. I moved from using an alias to a script for some reason I can't remember (and of cause I didn't write it in the commit message -_-).

[1] https://github.com/mbudde/homedir/blob/master/usr/bin/hgit

Hazel for hackers 14 years ago

There's this example from the README which seems to do what you are asking for:

    Maid.rules do
      rule 'Old files downloaded while developing/testing' do
        dir('~/Downloads/*').each do |path|
          if downloaded_from(path).any? {|u| u.match 'http://localhost'} && 1.week.since?(last_accessed(path))
            trash(path)
          end
        end
      end
    end