Git remove all files from gitignore

In this article let’s discuss about Git remove all files from gitignore. Let’s go through the following methods without any delay.

Method 1:

git ls-files -i --exclude-from=.gitignore | %{git rm --cached $_}

// works with windows powershell

If you are facing any issues with the above approach then try the alternative that is given below. It may look similar by have a try!

Method 2 :

git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached

Hope the above solution works.

Realted Posts : Ubuntu install elasticsearch terminal