Skip to content

Instantly share code, notes, and snippets.

@jeromecoupe
Last active September 21, 2020 10:38
Show Gist options
  • Save jeromecoupe/5237810 to your computer and use it in GitHub Desktop.
Save jeromecoupe/5237810 to your computer and use it in GitHub Desktop.
craftcms .gitignore (craft 3)
# Craft
# --------------------------
/.env
/vendor/
# files generated by build process
/web/dist/
# user uplodaded files
/web/uploads/
# DB Dumps
# --------------------------
/db_dumps/
# node modules
# --------------------------
/node_modules/
# misc
# --------------------------
.idea
.DS_Store
@aaronbushnell
Copy link

I like to include these things because they encapsulate most OS/editor/file system junk:

# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# OS or Editor folders
.DS_Store
Thumbs.db
.cache
.project
.settings
.tmproj
*.esproj
nbproject
*.sublime-project
*.sublime-workspace
*.komodoproject
.komodotools
_notes
dwsync.xml

@aaronbushnell
Copy link

Out of curiosity though, why would you want to ignore the .gitignore file? Couldn't someone then clone the repo (without the .gitignore) and be able to commit a .DS_Store file to it? I've never done this so I'm just wondering.

@BenParizek
Copy link

I think you may be able to ignore the entire runtime folder.

craft/storage/runtime/*

I've also added the backups folder as we keep backups elsewhere so no real need to have them in the repo too:

craft/storage/backups/*

@jeromecoupe
Copy link
Author

Thanks guys! Updated

@aaron: I keep .gitignore out because it is a git-specific file and, as such, I see it as not belonging in the repo itself (everybody has its own copy). That being said, now that I think about it after your comment, it makes sense to keep it in when working teams.

@jeromecoupe
Copy link
Author

Updated for Craft 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment