Je joue avec Facebook/React Native , et quand je lance git init
, je n'ai aucune idée de ce qui doit être ignoré, sauf le dossier node_modules
,
Dois-je valider tous les dossiers iOS?
Merci
Si vous regardez les exemples React Native:
https://github.com/facebook/react-native/tree/master/Exemples
Chacun d’entre eux a un répertoire avec un contenu similaire au répertoire iOS généré par react-native-cli. En regardant plus loin dans le fichier de projet Xcode, il y est également référencé, et regardez le contenu - il y a des choses comme l'écran de lancement.
Alors oui, le répertoire iOS est nécessaire.
En ce qui concerne node_modules, je vous suggère de regarder cette réponse qui fournit plus d’informations:
React Native CLI crée un fichier .gitignore
lorsque vous démarrez un nouveau projet:
react-native init <ProjectName>
Il couvre toutes les bases qui devraient/peuvent être ignorées.
Source: https://github.com/facebook/react-native/blob/master/local-cli/templates/HelloWorld/_gitignore
Nous suggérons ce .gitignore:
https://github.com/facebook/react-native/blob/v0.2.1/Examples/SampleApp/.gitignore
Il ignore à la fois les fichiers Xcode spécifiques à l'utilisateur et le répertoire node_modules
.
gitignore.io suggère le fichier .gitignore suivant pour react-native:
Créé par https://www.gitignore.io/api/reactnative
### ReactNative ###
# React Native Stack Base
### ReactNative.Xcode Stack ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
### ReactNative.Node Stack ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
### ReactNative.Buck Stack ###
buck-out/
.buckconfig.local
.buckd/
.buckversion
.fakebuckversion
### ReactNative.macOS Stack ###
*.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
### ReactNative.Gradle Stack ###
.gradle
**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### ReactNative.Android Stack ###
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Freeline
freeline.py
freeline/
freeline_project_description.json
### ReactNative.Linux Stack ###
*~
# 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*
# End of https://www.gitignore.io/api/reactnative
Il est probablement intéressant de noter que react-native init <project-name>
génère un fichier .gitignore
pour vous. Ce sera probablement à jour avec les outils actuels et les sorties de construction de React Native. Cela devrait donc être un bon point de départ.
L'utilisation de react-native-cli 1.0.0 et react-native 0.36.0 a généré le fichier .gitignore
suivant:
# 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/IJ
#
*.iml
.idea
.gradle
local.properties
# node.js
#
node_modules/
npm-debug.log
# BUCK
buck-out/
\.buckd/
Android/app/libs
Android/keystores/debug.keystore
Ceci est une question connexe: Que doit inclure le fichier Xcode 6 gitignore?
Il peut être divisé en trois catégories:
ma réponse est qui ont été inspectés dans la pratique:
### SVN template
.svn/
### Xcode template
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
### 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
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
.idea
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### TortoiseGit template
# Project-level settings
/.tgitconfig
*.swp
# node_modules/,Xcode and Webstorm will spend lots of time for indexing this dir
node_modules/
# ios/Pods,
ios/Pods/
# OS X temporary files that should never be committed
.DS_Store
src/components/.DS_Store
# user personal info,for example debug info
ios/ProjectName.xcodeproj/project.xcworkspace/
ios/ProjectName.xcodeproj/xcuserdata
# Podfile versions
ios/Podfile.lock
# Created by .ignore support plugin (hsz.mobi)
J'espère que ça vous aide!