by RHSeeger · 3y ago · 0 comments
> switch to another branch, the files will still be in your working copy but not listed in your .gitignore file
This is a failing of git, imo. There should be a .local.gitignore to somesuch, that is "added to" .gitignore. It's VERY common for me to have files that I want ignore, but are specific to me; they don't belong in the project's .gitignore. I know there are ways to do this, but all of them are clunky. There should be a simple, out of the box way to do it.
I think .git/info/exclude is what you're looking for? (and also the global ~/.config/git/ignore)
The same location as .gitignore seems like the obvious location for it, to me.
You can even ignoring changes in files that are already tracked with `git update-index --assume-unchanged <file>`
there's a newer flag for the same thing but my brain is hardcoded to the old "-u" option from "back in the day". It feels like a "simple, out of the box way to do it" to me.
Having a “local gitignore” makes a lot more sense. I’d like to be more explicit about which local files should be ignored.