So you want to add all your untracked files to your .gitignore

Here is a simple command that will take all current untracked files in your repo and append them to your .gitignore. It's not pretty or subtle, but it gets the job done.

#*
* This will list all the untracked files in your git
* repo and append them to .gitignore
*#
git ls-files --others --exclude-standard >> .gitignore

Comments