Skip to content

Commit

Permalink
Git: タグが迷子になる
Browse files Browse the repository at this point in the history
  • Loading branch information
ma91n committed Jan 2, 2025
1 parent 1147c1b commit 06af691
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion documents/forGitBranch/git_branch_standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ git merge --no-ff $SOURCE_SHA

# タグ規則

Gitにはタグ機能があり、リリースポイントとしてタグを作成する運用とする。
Gitには[タグ](https://git-scm.com/book/ja/v2/Git-%e3%81%ae%e5%9f%ba%e6%9c%ac-%e3%82%bf%e3%82%b0)機能があり、リリースポイントとしてタグを作成する運用とする。

これにより、リリースしたアプリケーションやライブラリに何か不具合があれば、切り戻しや原因追求が容易になる利点がある。

Expand All @@ -471,6 +471,11 @@ $ git tag "v1.0.4" -m "v1.0.4 🐛Fix item api log"
$ git tag "v1.0.4"
```

::: warning タグが迷子になる?

タグはmainなど永続ブランチで作成する必要がある。例えばfeatureブランチでタグを作成し、`git push origin {tag_name}` でリモートにプッシュしたとしても、`rebase` でその紐付けが消えてしまう。なぜなら、タグはコミットのハッシュに付与されるラベルであり、`rebase` でコミットのハッシュが変わると、どのコミットに対するタグなのか分からなくなってしまうからである。
:::

## タグの命名規則

- `v1.2.4` などの [セマンティックバージョニング](https://semver.org/lang/ja/) を基本とする
Expand Down

0 comments on commit 06af691

Please sign in to comment.