LoginSignup
8
6

More than 5 years have passed since last update.

Gitのタグのメッセージを上書きする

Last updated at Posted at 2016-11-04

対象者

Gitで管理しているソフトウェアのリリース用にタグをつけるときにtypoなどをしてしまいタグを付け直したい人

経緯

  1. タグつけた
    • git tag -a tagname -m "hogehoge"
  2. hogehoge部分を変えたくなった
    • tagを消して再登録は面倒
  3. タグのメッセージを(追記して)上書きしたい

実行コマンド

完全に上書き

git tag -a tagname -f -m "new message"

前回のメッセージを編集

git tag -a tagname -f

→ メッセージ編集画面へ(git commit --amendの場合と同じ)

オプション・引数説明

  • -a (--annotate): 注釈付きタグ作成
  • tagname: タグ名(各自変更)
  • -f (--force): タグが既に存在していたら置き換える
  • -m (--message): タグ付け時のメッセージ
8
6
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
8
6