如何使用npm脚本使用自定义提交消息推送到github?

时间:2017-06-09 13:59:53

标签: node.js git npm npm-scripts

在我的package.json我有这个

  "scripts": {
    "start": "gulp serve",
    "git": "git add . && git commit -m 'some-message' && git push --all"
  },

在终端中我运行npm run git并推送更改。但是如何动态更改提交消息?例如npm run git MESSAGE='another commit'

1 个答案:

答案 0 :(得分:10)

涉及一些npm技巧的解决方案可能包括:

--max_allowed_packet

被称为:

"scripts": {
  "git": "git add . && git commit -m",
  "postgit": "git push --all"
},

或:

npm run git -- "Message of the commit"