Cleaning up with Git
Sometimes, after running a build process, you may want to clean things up and start fresh with a clean workspace.
Because build outputs are typically listed in your .gitignore, you can use Git itself to remove those ignored files and directories.
To delete all files ignored by .gitignore, run:
git clean -Xfd
If you’d like to see what would be removed before actually deleting anything, do a dry run by adding the -n flag:
git clean -Xfd -n