LoginSignup
3
4

More than 5 years have passed since last update.

package.jsonのversionからgitタグを打つtips

Posted at

あれ、versionいくつだったっけ?ってhead package.jsonをして確認してからするの面倒なので.gitconfigにaliasを書いとく

jsonをパースするjqをインストールしておく

brew install jq

git verでローカルとoriginにタグを打つ
git unverでタグを消す

[alias]
  ver = "!f() { cat package.json | jq .version -r | xargs git tag; cat package.json | jq .version -r | xargs git push origin; };f"
  unver = "!f() { cat package.json | jq .version -r | xargs git tag -d; cat package.json | jq .version -r | sed -e 's/^/:/' | xargs git push origin; };f"
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4