Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommended .gitignore for react-native

I'm trying out react native and ejected into a full build environment. Sadly, the eject-script did not create a sensible .gitignore file.

Not knowing a lot about app-development, I wonder what directories I could .gitignore here?

I'm guessing:

  • android/build
  • android/app/build
  • android/.gradle/

Are these alright, or are there any more directories I should .gitignore?

like image 307
DeX3 Avatar asked Mar 04 '18 18:03

DeX3


People also ask

Which Gitignore template to choose for react native?

If you are using npm it should be package-lock. json and if you are using yarn it should be yarn.

Should Expo shared be committed?

Should I commit the ". expo-shared" folder? Yes, you should share the ". expo-shared" folder with your collaborators.


1 Answers

Below is the .gitignore file ships with the react-native init command. You can find the full file here.

# OSX # .DS_Store  # Xcode # build/ *.pbxuser !default.pbxuser *.mode1v3 !default.mode1v3 *.mode2v3 !default.mode2v3 *.perspectivev3 !default.perspectivev3 xcuserdata *.xccheckout *.moved-aside DerivedData *.hmap *.ipa *.xcuserstate project.xcworkspace  # Android/IntelliJ # build/ .idea .gradle local.properties *.iml  # node.js # node_modules/ package-lock.json # include if you are using npm - don't use both yarn and npm npm-debug.log yarn-error.log yarn.lock # include if you are using yarn - don't use both npm and yarn  # BUCK buck-out/ \.buckd/ *.keystore  # Fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use Fastlane to re-generate the # screenshots whenever they are needed. # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/  */fastlane/report.xml */fastlane/Preview.html */fastlane/screenshots  # Bundle artifact *.jsbundle 
like image 147
bennygenel Avatar answered Sep 20 '22 01:09

bennygenel