$ echo '.idea' >> .gitignore
$ git rm -r --cached .idea
$ git add .gitignore
$ git commit -m '(some message stating you added .idea to ignored entries)'
$ git push
for reference : https://www.david-merrick.com/2017/08/04/how-to-remove-the-idea-folder-from-git/