In order to remove untracked files in Git make use of the git clean command with -i option for interactive mode.
Example:% git clean -i -f
Would remove the following item:
HelloWorld.java
.temp
index.html
*** Commands ***
1: clean
2: filter by pattern
3: select by numbers
4: ask each
5: quit
6: help
What now> 1
Removing HelloWorld.java
Removing .temp
Removing index.html

-i (--interactive) --> Interactive Mode
-f (--force) --> Force
-d --> Include directories
-n (--dry-run) --> dry run
-q (--quiet) only report if errors
Read More: https://git-scm.com/docs/git-clean#Documentation/git-clean.txt---force
Have Questions? Post them here!
- [Fixed] Git Clone git@github.com: Permission denied (publickey) Could not read from remote repository Fatal error
- Github: How to Invite Collaborators
- Git Commit - Author identity unknown, Please tell me who you are email
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- Github: fatal: Authentication failed Support for password was removed on August 13, 2021
- Get List of all local branches git command
- Git Revision Questions Before the Interview
- git fatal: Authentication failed error [fix]
- How to Install Git on Ubuntu Linux
- GitHub: How to Search Code
- How to change Git Default Author and Committer details in Eclipse
- How to check your installed version of Git
- Install GitHub Command Line Tool on Mac
- How to Merge Branch into Master Branch
- Perform an Empty Commit in Git without anything in Staging Area
- Git Fix: fatal: refusing to merge unrelated histories Error
- How to undo last Git Commit on Local Repository?
- git command to remove/unstage files from staging area
- Step-by-Step: Setting up Docker + Ubuntu Linux + Git + GitHub Tutorial
- Remove git config at Local, Global or System Levels?
- Fix [oh-my-zsh] Cant update: not a git repository
- Git Config Command - A Deep Dive
- fatal: Unable to create '/c/git_repo/.git/index.lock': File exists. If no other git process is currently running, this probably means a git process crashed in this repository earlier.
- How to change directory in Git bash
- Indent Python code in Notepad++ - Python
- How to find Sublime Text path of packages installed - Sublime-Text
- Call PHP function on Button click using jquery ajax - PHP
- SharePoint Server 2016 Preview installation error - This Product Key isn't a valid Microsoft Office 2016 Product Key. Check that you've entered it correctly. - SharePoint
- Setting up Java JUnit Project with Eclipse + Maven Example - Java
- [fix] Loading class com.mysql.jdbc.Driver is deprecated - MySQL
- [Solution] Error: brew cask is no longer a brew command - MacOS
- Java Stream flatmap() Examples - Java