Remove .idea or any files/dir from your git repo

We always try to do things faster and accidentally we add .idea directory and other unnecessary files.
I have faced this situation mostly for projects where there is no .gitignore generated automatically. Later on, when I try to check the repo from another machine or my team members see it then I feel like Oh! not again!

Here is the code to remove any files if you want to remove it from your git repository.

If you want to remove any other files or dir then follow the steps like above.

Example: Removing a file name .DS_Store in Mac:

Hope it helps you!

Tech Enthusiast

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store