Skip to content

Instantly share code, notes, and snippets.

@elliot-huffman
Last active February 21, 2022 22:58
Show Gist options
  • Save elliot-huffman/c92b3e52053906816074170ada511962 to your computer and use it in GitHub Desktop.
Save elliot-huffman/c92b3e52053906816074170ada511962 to your computer and use it in GitHub Desktop.
A gitignore for all of your Apache Cordova needs.
# Cordova Global
plugins/
# iOS Platform
platforms/ios/build/
platforms/ios/www/
platforms/ios/cordova/console.log
*.xcuserdatad
# Android Platform
platforms/android/.gradle
platforms/android/build
platforms/android/assets/www
platforms/android/local.properties
platforms/android/CordovaLib/build
platforms/android/CordovaLib/gen
platforms/android/CordovaLib/local.properties
# wp8
platforms/wp8/bin
platforms/wp8/obj
platforms/wp8/www
platforms/wp8/.staging
platforms/wp8/*.suo
platforms/wp8/*.csproj.user
# Windows Universal App (Windows Platform)
platforms/windows/build
platforms/windows/www
platforms/windows/AppPackages
# Electron
platforms/electron/build
platforms/electron/build-res
platforms/electron/www
platforms/electron/config.xml
platforms/electron/electron.json
# Browser
platforms/browser/www
# res
resources/signing
# Node JS + TS
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pids
*.pid
*.seed
*.pid.lock
lib-cov
coverage
.nyc_output
.grunt
bower_components
.lock-wscript
build/Release
dist/
node_modules/
jspm_packages/
typings/
.npm
.eslintcache
.node_repl_history
*.tgz
.yarn-integrity
.env
.env.test
.cache
.next
.nuxt
.vuepress/dist
.serverless/
.fusebox/
.dynamodb/
# Windows
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.lnk
# Linux
.fuse_hidden*
.directory
.Trash-*
.nfs*
# Mac
.DS_Store
.AppleDouble
.LSOverride
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
.apdisk
@erikyuzwa
Copy link

Thanks! should also maybe add node_modules

@zhengzheli
Copy link

Thanks

@elliot-huffman
Copy link
Author

So true, needs node_module.
thanks for that comment. I need to integrate NPM/Node ignores.

@elliot-huffman
Copy link
Author

Updated to include node ignores, thx a million for that feedback

@erikyuzwa
Copy link

nice 🍸 - thanks

@elliot-huffman
Copy link
Author

np

@vamshik113
Copy link

Need to add plugin/

@elliot-huffman
Copy link
Author

Good catch, adding

@erikyuzwa
Copy link

can't seem to emoji within gist comments, but thanks @elliot-labs

@elliot-huffman
Copy link
Author

No prob 😁😁😁

@Baneeishaque
Copy link

Baneeishaque commented Jan 11, 2020

Integrate Linux too...
https://www.gitignore.io/api/linux

@salikadave
Copy link

Super useful, thank you !

@elliot-huffman
Copy link
Author

Hi @Baneeishaque,

Added Linux!

@elliot-huffman
Copy link
Author

Super useful, thank you !

No prob :)

@Markus-Ende
Copy link

# Electron Platform
platforms/electron/build
platforms/electron/build-res
platforms/electron/www

Not sure, if there's more.
Thanks for sharing!

@elliot-huffman
Copy link
Author

# Electron Platform
platforms/electron/build
platforms/electron/build-res
platforms/electron/www

Not sure, if there's more.
Thanks for sharing!

Added electron support, thx for the heads up!

@danielo515
Copy link

platforms/android/assets/www Is no longer correct, it is under platforms/android/app/src/main/assets/www now

@danielo515
Copy link

Acording to latest docs, you should not be including platforms nor plugins folders on version control: https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#version-control

So this gitignore can be greatly simplified

@esskar
Copy link

esskar commented Aug 12, 2020

Acording to latest docs, you should not be including platforms nor plugins folders on version control: https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#version-control

So this gitignore can be greatly simplified

to exclude platforms folder makes no sense if you have modified/additional code imho

@elliot-huffman
Copy link
Author

It is a hit or miss sorta thing. One is supposed to be able to have the config file inject your changes but that doesn't cover every scenerio. I think I am gonna keep it this way and I can have a fork that does the platform and plugins folder.

@elliot-huffman
Copy link
Author

platforms/android/assets/www Is no longer correct, it is under platforms/android/app/src/main/assets/www now

thx for the heads up, I'll get it updated shortly

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