From the Github specs...
The purpose of gitignore files is to ensure that certain files not tracked by git remain untracked.
Create a .gitignore file all your own:
These steps use vim to update the .gitignore file
  1. Navigate to the folder that contains the files for your project.
  2. If you have not yet created a .git file, run the git commit command.
  3. Create a .gitignore file by running touch .gitignore. The file name ".gitignore" is case sensitive and the name of the file matters. Git will look for a file with that name and will not stage (add) or commit files that is is told to ignore.
  4. Use vim to open the file by running vim .gitignore. This will open a text editor called "Vim" inside your console.
  5. Press the escape key to enter and exit text-entry mode.
  6. Once you have updated your .gitignore files you can save and exit vim by pressing escape, entering :wq, and pressing return/enter
Example:
# Don't track content of these folders
node_modules/
someOtherfoler/


# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so

*.so

# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip