You can use vim as well.
vim .gitignore
- in a new line write
Icon
, then - press ctrl+v and then press Enter
- repeat step 3
- save and exit (shortcut: ZZ)
Now you should have Icon^M^M
and it’s done 🙂
For a smarter use you could add it to your gitignore global config file in ~/.gitignore_global
.