-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtag.tex
95 lines (62 loc) · 1.87 KB
/
tag.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
% This is part of the ``Git First Step''.
% Copyright 2014, 2020 Yoshida Shin.
% See the file slide.tex for copying conditions.
\begin{frame}[t]{tag}{}
branch の指す commit は開発とともに移動する
\vspace{4ex}
リリースしたバージョンの commit などは移動してほしくない
(後から見直せるようにしたい)
\vspace{4ex}
\onslide*<2>{
commit への固定されたリンクとして tag が存在する
}
\end{frame}
\begin{frame}[t]{tag}{}
commit に移動しないリンクをつける
\vspace{4ex}
\onslide*<1,5>{
現在の tag 一覧を表示
\vspace{2ex}
\$ git tag
\vspace{2ex}
tag は無いので何も表示されない
}
\onslide*<2>{
tag を作成
\vspace{2ex}
\$ git tag v0.0.1
\vspace{2ex}
HEAD の向いている commit に対して v0.0.1 という tag をつける
}
\onslide*<3>{
\$ git tag
\vspace{2ex}
tag 一覧を表示
\vspace{2ex}
\code{v0.0.1}
}
\onslide*<4>{
\$ git tag -d v0.0.1
\vspace{2ex}
tag v0.0.1 を削除
}
\end{frame}
\begin{frame}[t]{tag}{コマンド補足}
\begin{itemize}
\item git tag \textit{tag-name} [\textit{commit}]
で commit を指す tag を作成
commit は branch, HEAD, ハッシュ値等で指定
commit のデフォルトは HEAD
\vspace{2ex}
\item tag を remote repository へ転送するには
git push \textit{URI} tag \textit{tag-name}
\vspace{2ex}
\item remote repository の tag を削除するには
git push \textit{URI} :refs/tags/\textit{tag-name}
\vspace{2ex}
\item remote repository の tag も git fetch {\dhyphen}all -p で取得可能
\vspace{2ex}
\item merge や checkout の commit 指定に tag も使用可能
ただし、その場合 HEAD が branch から外れるので注意
\end{itemize}
\end{frame}