It's better to add dev environment related ignores (.idea) in your individual .git/info/exclude file since it doesn't have any relevance to the actual project code.