I would argue that you should decide between explicitly adding it or ignoring it, or deliberately doing neither.
>This combines well with things like a PS1 that indicates if you have any unclean state (including both changes and untracked files).
If you intend to keep untracked files in your directory, choose a PS1 that does not bother you about untracked files.
You are losing important information from git status when you exclude untracked files that you are actually working on and not just some random junk your ide generated. What if you look at the git status and conclude that there are no unchanged files worth tracking and then with that false sense of safety decide to run 'git clean -fdx'? You would lose those files permanently!
I honestly don't understand why the presence of untracked files in your git status is such a bother to you!? Like how exactly does it hurt?
I certainly don’t want a meaningful code change sandwiched between an open editor swap file and some for-my-eyes-only temporary design scratch pad.
> then with that false sense of safety decide to run 'git clean -fdx'? You would lose those files permanently!
Correct, and that’s one of the reasons why the `-f` switch might be a poor fit. I use `-i` instead.
We are specifically not talking about the junk files created by editors and ides here.
We are talking about things like notes and exploratory code that you have written that you have no intention of committing, at least not right away. Why wouldn't you want to see them in your `git status`?
Another problem with putting such files in gitignore is that those files will become invisible to an increasingly large number of tools (vscode, ag aka silversearcher, ripgrep, emacs's projectile to name a few) that rely on gitignore to filter out unwanted files. So now, as far as these tools are concerned you have put your notes and experiments in the same category of files as editor junk and build artifacts. You either search them all or none at all.
I tend to function poorly around cognitive clutter. It distracts me from the important stuff: the files I’ve decided to put under version control. YMMV.
> will become invisible to an increasingly large number of tools (vscode, ag aka silversearcher, ripgrep, emacs's projectile to name a few)
That doesn’t really seem to be the case with VS Code. Ignored files appear grey but they’re still showing up for me.
They show up greyed out in the explorer yes, but they won't appear when you navigate with "Go to File" (ctrl+p) and they won't be searched through with "Search" (ctrl+shift+f).