Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.gitignore file for a general web project - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20181206
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore
# to download this file
#
# This file is tailored for a general web project, it
# is NOT optimized for a WordPress project. See
# https://gist.github.com/salcode/b515f520d3f8207ecd04
# for a WordPress specific .gitignore
#
# This file specifies intentionally untracked files to ignore
# http://git-scm.com/docs/gitignore
#
# NOTES:
# The purpose of gitignore files is to ensure that certain files not
# tracked by Git remain untracked.
#
# To ignore uncommitted changes in a file that is already tracked,
# use `git update-index --assume-unchanged`.
#
# To stop tracking a file that is currently tracked,
# use `git rm --cached`
#
# Change Log:
# 20190705 ignore private/secret files
# 20181206 remove trailing whitespaces
# 20180714 unignore .phpcs.xml.dist
# 20170502 unignore composer.lock
# 20170502 ignore components loaded via Bower
# 20150326 ignore jekyll build directory `/_site`
# 20150324 Reorganized file to list ignores first and whitelisted last,
# change WordPress .gitignore link to preferred gist,
# add curl line for quick installation
# ignore composer files (vendor directory and lock file)
# 20140606 Add .editorconfig as a tracked file
# 20140418 remove explicit inclusion
# of readme.md (this is not an ignored file by default)
# 20140407 Initially Published
#
# -----------------------------------------------------------------
# ignore all files starting with . or ~
.*
~*
# ignore node/grunt dependency directories
node_modules/
# ignore composer vendor directory
/vendor
# ignore components loaded via Bower
/bower_components
# ignore jekyll build directory
/_site
# ignore OS generated files
ehthumbs.db
Thumbs.db
# ignore Editor files
*.sublime-project
*.sublime-workspace
*.komodoproject
# ignore log files and databases
*.log
*.sql
*.sqlite
# ignore compiled files
*.com
*.class
*.dll
*.exe
*.o
*.so
# ignore packaged files
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# ignore private/secret files
*.der
*.key
*.pem
# -------------------------
# BEGIN Whitelisted Files
# -------------------------
# track these files, if they exist
!.gitignore
!.editorconfig
!.phpcs.xml.dist
@fredgrott

This comment has been minimized.

Copy link

@fredgrott fredgrott commented Dec 1, 2017

Thanks for posting this as I was looking for exactly this gitignore file....switched from native java android coding to web and design and did not have an adequate gitignore setup for web projects

@juanma386

This comment has been minimized.

Copy link

@juanma386 juanma386 commented Jul 6, 2018

WooOoow, very good, thanks.

@itamarsky

This comment has been minimized.

Copy link

@itamarsky itamarsky commented Oct 7, 2018

Thx!

@JohannesBe

This comment has been minimized.

Copy link

@JohannesBe JohannesBe commented Jul 5, 2019

Please add a section for secrets (e.g. .pem, .key files etc)

@salcode

This comment has been minimized.

Copy link
Owner Author

@salcode salcode commented Jul 5, 2019

@JohannesBe thanks for the feedback, this is a good idea

Off the top of my head it seems we should add the following

*.key
*.pem
*.der
@juanpabloisabella

This comment has been minimized.

Copy link

@juanpabloisabella juanpabloisabella commented Jul 22, 2020

Thanks!!

@PotLid

This comment has been minimized.

Copy link

@PotLid PotLid commented Jul 27, 2020

Thanks for the sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.