【问题标题】:Recommended .gitignore for Node-RED推荐用于 Node-RED 的 .gitignore
【发布时间】:2019-11-05 03:37:00
【问题描述】:

是否有标准或推荐的 .gitignore 文件用于 Node-RED 项目?或者是否有应该忽略的文件或文件夹?例如,是否应该忽略 .config.jsonflow_cred.json 之类的文件?

目前我使用的是由gitignore.io 生成的 Node 模板(见下文),但这不包含任何特定于 Node-RED 的内容。

我发现这些带有 .gitignore 文件的 github 项目:

但我不确定这些是否适用于任何 Node-RED 项目。

Node .gitignore 文件:

# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node

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

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# 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
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# 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
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# react / gatsby 
public/

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# End of https://www.gitignore.io/api/node

【问题讨论】:

    标签: node.js gitignore node-red


    【解决方案1】:

    您参加过节点红色项目吗?这是video 的链接,这里是documentation 的设置方法。

    它会创建一个包含您的流程的文件夹、加密您的凭据、添加一个自述文件和一个包含您的包依赖项的文件。它还允许您设置您的 git/GitHub 帐户,以便您可以从红色节点控制台安全地推送到本地和远程存储库。

    项目文件夹中的 .gitignore 文件会自动以 *.backup 开头

    这是因为 node-red 会在您每次部署节点时创建文件副本并附加 .backup

    这样,您唯一需要单独备份的是项目文件夹之外的一个名为 config_projects.json 的文件,该文件存储您凭据的加密密钥。

    我刚刚设置好了,我真的很满意。

    【讨论】:

      猜你喜欢
      • 2018-08-12
      • 1970-01-01
      • 2017-12-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多