Using gitignore.io
Toptal provides a very helpful service at gitignore.io.
Enter the programming language, Operating system, framework you are using:
For Hugo, the static site generator running this blog, below .gitignore
file is generated:
# Created by https://www.toptal.com/developers/gitignore/api/hugo
# Edit at https://www.toptal.com/developers/gitignore?templates=hugo
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# End of https://www.toptal.com/developers/gitignore/api/hugo
Check the GitHub repository
Find some inspiration by checking the .gitignore
file created by the core team of the library/framework/… you are using.
Again, for Hugo:
/hugo
docs/public*
/.idea
hugo.exe
*.test
*.prof
nohup.out
cover.out
*.swp
*.swo
.DS_Store
*~
vendor/*/
*.bench
*.debug
coverage*.out
dock.sh
GoBuilds
dist
hugolib/hugo_stats.json
resources/sunset.jpg
vendor
GitHub’s template collection
Check out the template collection from GitHub. This list is the base for the .gitignore
templates which are generated when creating new repositories.