-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfetch.tex
165 lines (116 loc) · 3.82 KB
/
fetch.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
% This is part of the ``Git First Step''.
% Copyright 2014, 2020 Yoshida Shin.
% See the file slide.tex for copying conditions.
\begin{frame}[t]{fetch}{複数人で開発する}
remote repository の更新を local に反映
\vspace{4ex}
\onslide*<1>{
local\_rep で更新
\vspace{2ex}
\$ cd \~{}/local\_rep
\$ git add g
\$ git commit -m 'Add g.'
\$ git push origin master
}
\onslide*<2>{
clone\_rep に反映
\vspace{2ex}
\$ cd \~{}/clone\_rep
\$ git fetch {\dhyphen}all -p
\$ git merge remotes/origin/master
}
\end{frame}
\begin{frame}[t]{中で起きている事}{複数人で開発する}
\begin{columns}
\begin{narrowcolumn}
\begin{repository}{local}
\onslide<2->{
\node (c7) [commit, rectangle split, rectangle split parts=1] at (0em, 6.5ex){
\commitmessage{Add g.}
};
}
\node (c6) [commit, rectangle split, rectangle split parts=1] at (0em, -2ex){
\commitmessage{Add f.}
};
\onslide*<2->{\draw (c6) -- (c7);}
\end{repository}
\end{narrowcolumn}
\begin{narrowcolumn}
\begin{repository}{remote}
\onslide<3->{
\node (c7) [commit, rectangle split, rectangle split parts=1] at (0em, 6.5ex){
\commitmessage{Add g.}
};
}
\node (c6) [commit, rectangle split, rectangle split parts=1] at (0em, -2ex){
\commitmessage{Add f.}
};
\onslide*<3->{\draw (c6) -- (c7);}
\end{repository}
\end{narrowcolumn}
\begin{halfcolumn}
\begin{repository}{clone}
\onslide<8>{
\node (c7) [commit, rectangle split, rectangle split parts=3] at (0em, 5ex){
\commitmessage{Add g.}
\nodepart{second}{master{\HEAD}}
\nodepart{third}{\remotebranch{remotes/origin/master}}
};
}
\onslide*<6-7>{
\node (c7) [commit, rectangle split, rectangle split parts=2] at (0em, 6ex){
\commitmessage{Add g.}
\nodepart{second}{\remotebranch{remotes/origin/master}}
};
}
\onslide<8>{
\node (c6) [commit, rectangle split, rectangle split parts=1] at (0em, -3ex){
\commitmessage{Add f.}
};
}
\onslide*<6-7>{
\node (c6) [commit, rectangle split, rectangle split parts=2] at (0em, -1.5ex){
\commitmessage{Add f.}
\nodepart{second}{master{\HEAD}}
};
}
\onslide*<-5>{
\node (c6) [commit, rectangle split, rectangle split parts=3] at (0em, 0ex){
\commitmessage{Add f.}
\nodepart{second}{master{\HEAD}}
\nodepart{third}{\remotebranch{remotes/origin/master}}
};
}
\onslide*<6->{\draw (c6) -- (c7);}
\end{repository}
\end{halfcolumn}
\end{columns}
\vspace{2ex}
\onslide*<2>{
\$ cd \~{}/local\_rep
\$ git add g
\$ git commit -m 'Add g.'
}
\onslide*<3>{\$ git push origin master}
\onslide*<4>{\$ cd \~{}/clone\_rep}
\onslide*<5-6>{
\$ git fetch {\dhyphen}all -p
\vspace{2ex}
remotes 以下の branch を最新版にバージョンアップ
}
\onslide*<7-8>{
\$ git merge remotes/origin/master
\vspace{2ex}
master に remotes/origin/master の更新を適用
}
\end{frame}
\begin{frame}[t]{fetch コマンド補足}{複数人で開発する}
\begin{itemize}
\item git fetch {\dhyphen}all は全ての remotes 以下の branch を最新にする
(local に存在しない branch は新規作成する)
\vspace{2ex}
\item git fetch -p は remote reopsitory から削除された branch を local からも削除する
\vspace{2ex}
\item git pull のデフォルトの動作は、git fetch と git merge を行うもの
\end{itemize}
\end{frame}