推荐 .gitignore 用于 react-native

新手上路,请多包涵

我正在尝试 react native 并将 eject 编入完整的构建环境。遗憾的是,弹出脚本没有创建一个合理的 .gitignore 文件。

对应用程序开发了解不多,我想知道我可以在这里使用哪些目录 .gitignore

我正在猜测:

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

这些都好吗,还是我应该有更多目录 .gitignore

原文由 DeX3 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 515
1 个回答

下面是 .gitignore 文件随 react-native init 命令一起提供。您可以在 此处 找到完整文件。

 # 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

原文由 bennygenel 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
logo
Stack Overflow 翻译
子站问答
访问
宣传栏