logoalt Hacker News

judofyryesterday at 2:34 PM4 repliesview on HN

Not sure where I picked up this, but I’ve added this to my global Git ignore:

    attic
That way you can just create an attic directory in any project where you can keep random stuff that should never be committed. I’ve yet to find a repo which actually has such a directory checker in.

Replies

deathanatosyesterday at 10:05 PM

You can also sort of invert this, but you have to do it on a case by case basis.

Let's say you have a directory like attic; you can put inside a `attic/.gitignore`:

  /**
& then that directory (and anything in it) is ignored, including the ignore file itself.

I usually name my version of this directory the single character U+1F4A9, which HN refuses to permit me to put in a comment ;)

weinzierlyesterday at 4:32 PM

Mine is

    aux
and I hide it by putting a .gitignore in it that just contains am asterisk (*), nothing else, that way it ignores itself and anything in it.
show 3 replies
williamjacksonyesterday at 2:38 PM

I do this too! But I call it `.local`

show 2 replies
thewisenerdyesterday at 7:46 PM

mine's `scratch/`

hasn't tripped me up (yet)