9

在我的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'

4

1 回答 1

20

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

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

被称为:

npm run git -- "Message of the commit"

或者:

npm run git -- Message
于 2017-06-09T14:28:45.327 回答