This is what I am using.
The content should be save in the .gitignore after ios and android envirment like (signature, config file) init,
Then the auto generate file like (index.android.bundle,main.jsbundle) need to be removed using git rm -f ---cached (file path) ,then commit it,then create a new one.
That's becasue the auto generate file don't need to be commited.
node_modules/**/*
.expo/*
npm-debug.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/
package-lock.json
# macOS
.DS_Store
ios/
ios/*
ios/main.jsbundle
ios/**/*
android/
android/*
android/**/*
.vs/
*.log
# 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
*.hprof
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore
# Bundle artifacts
*.jsbundle
# CocoaPods
/ios/Pods/
# Expo
.expo/
web-build/