To avoid adding and commiting unwanted files to your repository (for example generated machine code, or temporary files) you can use the .gitignore file.
Create this file in any directory of your repository and add the file to the repository.
echo "*.png" >> .gitignore git add .gitignore git commit -m "Ignore all PNG files"
In this file you will give a list of files you want git to ignore. If the files are already part of the git history, it will ignore new changes to the file and if it's not tracked it will ignore it alltogether (unless you specifically add it with git add myfile).
Each line of the gitignore file can contain either a file name, a full path to a file, a directory or a pattern. Here are some examples:
*.png image.png images/image.png *.swp *.pdf *.aux *.lof *.log *.lot *.fls *.out
Finally you can find here a list of gitignore example and templates: https://github.com/github/gitignore