哪些文件或文件夹应该在 React 项目的 .gitignore 中?

新手上路,请多包涵

我正在制作一个反应项目并在笔记本电脑和 Windows 10 桌面上使用 Linux mint。我想知道,我应该在 .gitignore 中保留哪些文件或文件夹,这样我就不必在切换计算机时清理缓存和安装 npm。

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

阅读 1.4k
2 个回答

何必?只需将您的浏览器指向 gitignore.io 并选择您正在使用的所有工具和技术。您将自动生成一个 .gitignore 文件。

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

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Distribution directories
dist/

# 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

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

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