I think this is an easy way for adding a .gitignore file to an existing repository.
Prerequisite:
You need a browser to access your github account.
Steps
- Create a new file in your required (existing) project and name it .gitignore. You will a get suggestive prompt for .gitignore templates as soon as you name the file as .gitignore. Either use these templates or use gitignore.io to generate the content of your gitignore file.
- Commit the changes.
- Now clone this repository.
Have fun!