Is there a handy way to ignore all untracked files and folders in a git repository?
(I know about the .gitignore.)
So git status would
In case you are not on Unix like OS, this would work on Windows using PowerShell
git status --porcelain | ?{ $_ -match "^\?\? " }| %{$_ -replace "^\?\? ",""} | Add-Content .\.gitignore
However, .gitignore file has to have a new empty line, otherwise it will append text to the last line no matter if it has content.
This might be a better alternative:
$gi=gc .\.gitignore;$res=git status --porcelain|?{ $_ -match "^\?\? " }|%{ $_ -replace "^\?\? ", "" }; $res=$gi+$res; $res | Out-File .\.gitignore