Skip to content

Instantly share code, notes, and snippets.

@rock3r
Last active April 13, 2024 12:52
Show Gist options
  • Save rock3r/ac33be8ae9df940e254ca4b4bb06fa9d to your computer and use it in GitHub Desktop.
Save rock3r/ac33be8ae9df940e254ca4b4bb06fa9d to your computer and use it in GitHub Desktop.
A template .gitignore for Kotlin projects using Gradle (with additional content for Android projects)
## Seb's .gitignore template
# You can find the most up-to-date version at https://go.sebastiano.dev/gitignore
# Partly based on templates by https://plugins.jetbrains.com/plugin/7495--ignore
# Released under a CC-0 License https://creativecommons.org/share-your-work/public-domain/cc0/
### Windows template
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Linux template
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
*.iml
*.ipr
*.iws
/.idea/*
# Exclude non-user-specific stuff
!.idea/.name
!.idea/codeInsightSettings.xml
!.idea/codeStyles/
!.idea/copyright/
!.idea/dataSources.xml
!.idea/detekt.xml
!.idea/encodings.xml
!.idea/externalDependencies.xml
!.idea/file.template.settings.xml
!.idea/fileTemplates/
!.idea/icon.svg
!.idea/inspectionProfiles/
!.idea/runConfigurations/
!.idea/scopes/
!.idea/vcs.xml
### Kotlin template
# Compiled class file
*.class
# Log file
*.log
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Gradle template
.gradle
# Note that you may need to exclude by hand other folders
# named build if necessary (e.g., in src/)
**/build/
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle/wrapper/gradle-wrapper.jar
# Cache of project
.gradletasknamecache
### Android-specific stuff
# Built application files
*.apk
*.ap_
*.aab
*.apks
# Files for the Dalvik VM
*.dex
# Generated files
bin/
gen/
# Local configuration file (sdk path, etc)
local.properties
# Google/Firebase secrets
google-services.json
@rock3r
Copy link
Author

rock3r commented May 16, 2022

Great point, added! Thanks, @keyboardsurfer 🙌

@tfcporciuncula
Copy link

I think adding !.idea/file.template.settings.xml would be a nice addition to make sure you don't get just the templates themselves, but also their settings (how the file name should be, whether to reformat according to the style, and whether to enable live templates). It would be nice if the settings lived in the same directory as the templates, though.

@rock3r
Copy link
Author

rock3r commented May 24, 2022

@tfcporciuncula good idea, have added that to the template. Thanks :)

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