How to remove untracked files from current branch GIT?

How to remove untracked files from current branch GIT. many times we need to face that when we run command “git status” at that time git show you untracked files or folder.

How we can remove that untracked files and folder from local git using the command.

Let’s see how we can remove untracked files from local git.

git clean -f

Let’s see how we can remove untracked files from local git.

git clean -d

Also, we can remove untracked files and folders using the single command like.

git clean -f -d

After running above command you can check the untracked files removed or not using below command.

git status

If you face any issue after using above git command write the comment below.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s