0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Gitについて勉強する。第八弾 (タグ付けをしてみよう 編)

Last updated at Posted at 2019-10-06

タグとは

コミットを参照しやすくするために、わかりやすい名前をつけることができます。
リリース時のタイミングでつけることが多いらしいです。

タグの種類

  • annotated(注釈付き)

    • 情報量が多いタグ、名前、注釈、記入者の情報が記載されます。
  • lightweight(軽量版)

    • 省略したタグ、名前のみ記載されます。

タグを検索する

git tag

パターンで検索する

タグに日付を使用して管理していた場合を想定します。

git tag -l 201910

  • 20191006
  • 20191005
  • 20191004

タグを追加する

annotatedで作成

  • git tag -a "タグ名" -m "メッセージ"

例:git tag -a 20191006 -m "ver 1.01 「いいね」機能を追加"

lightweightで作成

  • git tag "タグ名"

昔のコミットから作成する場合

コミット名を指定しない場合、最新のコミットにタグ付けされますが、コミットを指定することもできます。

  • git tag "タグ名" "コミット名"

タグの情報を表示する。

  • git show "タグ名"

タグを削除する

  • git tag -d "タグ名"

次・最終弾

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?