繁体   English   中英

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

[英]How to push to github with custom commit message with 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'

涉及一些npm欺骗的解决方案可能包括:

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

被称为:

npm run git -- "Message of the commit"

要么:

npm run git -- Message

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM