1
00:00:00,000 --> 00:00:03,340
Welcome back, my fellow
game developers.

2
00:00:03,339 --> 00:00:05,469
In this video, we are
going to be learning

3
00:00:05,470 --> 00:00:08,350
everything about
version control,

4
00:00:08,350 --> 00:00:13,830
source tree, and creating
repositories of our projects.

5
00:00:13,825 --> 00:00:15,225
So as you can see right here,

6
00:00:15,220 --> 00:00:17,090
we've created a new project

7
00:00:17,094 --> 00:00:19,574
and we've downloaded
source tree.

8
00:00:19,570 --> 00:00:22,060
We now have a couple
of commits in here,

9
00:00:22,060 --> 00:00:24,370
and we actually
reverted something.

10
00:00:24,370 --> 00:00:26,170
We've created our
initial commit,

11
00:00:26,170 --> 00:00:28,120
added a cube, reverted it.

12
00:00:28,120 --> 00:00:30,570
We can actually
reverse this commit.

13
00:00:30,565 --> 00:00:32,785
A can. So click on Yes.

14
00:00:32,785 --> 00:00:35,785
As you can see, we
can go back to Unity

15
00:00:35,785 --> 00:00:39,405
reload and we have
our cube right here.

16
00:00:39,400 --> 00:00:42,480
We will be learning
everything in minute detail.

17
00:00:42,480 --> 00:00:45,310
So give me your
entire concentration.

18
00:00:45,305 --> 00:00:46,925
This is very important.

19
00:00:46,925 --> 00:00:50,335
It's an extremely helpful video

20
00:00:50,330 --> 00:00:52,610
or lesson and we'll
stay with you

21
00:00:52,610 --> 00:00:55,190
forever as long as you
are committed to becoming

22
00:00:55,190 --> 00:00:58,480
a professional programmer
or game developer.

23
00:00:58,475 --> 00:01:03,505
So let's not waste any more
time and let's get started.

24
00:01:03,500 --> 00:01:07,250
O k. So version control

25
00:01:07,250 --> 00:01:10,070
that and put on my
laser version control.

26
00:01:10,070 --> 00:01:11,680
It's hard to learn.

27
00:01:11,675 --> 00:01:13,415
It's even harder to teach,

28
00:01:13,415 --> 00:01:16,465
but I'll try to keep it
as simple as possible.

29
00:01:16,460 --> 00:01:18,470
And when you get the hang of it,

30
00:01:18,470 --> 00:01:22,330
trust me, it's very
simple and easy to use.

31
00:01:22,325 --> 00:01:24,925
Plus it's an indispensable skill

32
00:01:24,920 --> 00:01:27,200
that you need to
learn if you are

33
00:01:27,200 --> 00:01:30,500
looking to become a
professional game developer

34
00:01:30,499 --> 00:01:32,739
or even a professional program.

35
00:01:32,735 --> 00:01:36,395
So let's get started
with what is.

36
00:01:36,395 --> 00:01:39,535
First of all, it's a
system that is responsible

37
00:01:39,530 --> 00:01:42,880
for managing changes
to computer programs.

38
00:01:42,875 --> 00:01:45,085
So this means that whenever we

39
00:01:45,080 --> 00:01:47,420
create changes in our programs,

40
00:01:47,420 --> 00:01:48,980
we can actually save

41
00:01:48,980 --> 00:01:53,420
those changes at each
step of our project.

42
00:01:53,420 --> 00:01:56,570
This way, we can first of
all check what we did.

43
00:01:56,570 --> 00:02:00,380
We can create different
kinds of versions where we

44
00:02:00,380 --> 00:02:04,120
can go back and change the
things that we've created.

45
00:02:04,115 --> 00:02:07,135
It allows for a better teamwork.

46
00:02:07,130 --> 00:02:08,660
So for example,
let's say you have

47
00:02:08,660 --> 00:02:12,290
four or five people working
on the same project,

48
00:02:12,290 --> 00:02:13,780
but each one of them has

49
00:02:13,775 --> 00:02:16,615
a different task that
they need to create.

50
00:02:16,610 --> 00:02:18,080
So version control is

51
00:02:18,080 --> 00:02:21,310
a very good way of
handling all of this.

52
00:02:21,305 --> 00:02:22,945
And why do we need it?

53
00:02:22,940 --> 00:02:26,410
Well, why we, we
actually use it?

54
00:02:26,410 --> 00:02:29,260
Well, we'll use it to
remember previous version of

55
00:02:29,255 --> 00:02:33,125
our game and have more
flexibility to experiment.

56
00:02:33,125 --> 00:02:35,725
Usually, game development is

57
00:02:35,720 --> 00:02:37,910
a environment where you

58
00:02:37,910 --> 00:02:40,490
require a lot of
experimentations.

59
00:02:40,490 --> 00:02:43,840
For example, you want
to add some kind of

60
00:02:43,835 --> 00:02:45,865
property to some kind of

61
00:02:45,860 --> 00:02:49,000
game object and maybe it
breaks your entire project.

62
00:02:48,995 --> 00:02:52,775
So you want to always
have a previous version

63
00:02:52,775 --> 00:02:54,685
of your project before adding

64
00:02:54,680 --> 00:02:56,860
this game breaking mechanic.

65
00:02:56,855 --> 00:03:00,805
So you can always go back
and start fresh from there.

66
00:03:00,800 --> 00:03:03,190
So this is extremely important,

67
00:03:03,185 --> 00:03:06,595
especially for game developers
that always need to be

68
00:03:06,590 --> 00:03:09,110
experimenting with new ideas

69
00:03:09,110 --> 00:03:11,830
and things in their
games and projects.

70
00:03:11,825 --> 00:03:13,765
And how are we going to use it?

71
00:03:13,760 --> 00:03:15,410
Well, we are going to be using

72
00:03:15,410 --> 00:03:17,360
something called source tree,

73
00:03:17,360 --> 00:03:19,430
and this is version control.

74
00:03:19,430 --> 00:03:21,710
It allows us to create
different versions.

75
00:03:21,710 --> 00:03:24,490
And its first of
all, it's for free.

76
00:03:24,485 --> 00:03:28,285
It's very easy for
beginners, very flexible,

77
00:03:28,280 --> 00:03:31,700
and it has a very
simple interface

78
00:03:31,699 --> 00:03:34,239
that we can use as beginners.

79
00:03:34,235 --> 00:03:36,925
So let's go ahead and
download source tree.

80
00:03:36,920 --> 00:03:39,080
Let me show you where
we can do that.

81
00:03:39,080 --> 00:03:40,750
If you open up

82
00:03:40,745 --> 00:03:44,045
Google Chrome or any
browser that you have,

83
00:03:44,045 --> 00:03:46,165
simply go to Google and right in

84
00:03:46,160 --> 00:03:48,410
here, download source tree.

85
00:03:48,410 --> 00:03:50,800
You should find a
link right here,

86
00:03:50,795 --> 00:03:52,985
and it should be
the source tree.

87
00:03:52,985 --> 00:03:53,605
Up.

88
00:03:53,600 --> 00:03:57,430
When you click on it, you go
right here to their website.

89
00:03:57,425 --> 00:03:58,745
If you scroll up,

90
00:03:58,745 --> 00:04:00,235
you can see that you have

91
00:04:00,230 --> 00:04:02,500
the option to
download for Windows.

92
00:04:02,495 --> 00:04:04,495
But if you are on a Mac,

93
00:04:04,490 --> 00:04:07,760
make sure that you click
on here and you download

94
00:04:07,759 --> 00:04:12,199
source tree for Mac OS or
it will not work for you.

95
00:04:12,200 --> 00:04:13,460
So if you have a Mac,

96
00:04:13,460 --> 00:04:14,980
download the Mac version,

97
00:04:14,975 --> 00:04:17,315
if you have a Windows,

98
00:04:17,315 --> 00:04:19,745
download the Windows version.

99
00:04:19,745 --> 00:04:20,885
Simple enough.

100
00:04:20,885 --> 00:04:22,975
Now, when you
finish downloading,

101
00:04:22,970 --> 00:04:25,570
you should get this
file right here.

102
00:04:25,565 --> 00:04:27,145
And when you double-click on it,

103
00:04:27,140 --> 00:04:29,260
you should start
the installation.

104
00:04:29,255 --> 00:04:31,565
Now because I already
have source tree,

105
00:04:31,565 --> 00:04:34,145
I will not be installing
it another time.

106
00:04:34,145 --> 00:04:35,665
I will just take you through

107
00:04:35,660 --> 00:04:38,360
the process of
actually installing.

108
00:04:38,360 --> 00:04:39,980
Okay, So this is

109
00:04:39,980 --> 00:04:43,220
the first window that
will pop up for you.

110
00:04:43,220 --> 00:04:44,960
First of all, you need to agree

111
00:04:44,960 --> 00:04:46,550
to the license, of course.

112
00:04:46,550 --> 00:04:49,930
And you can maybe turn this
off if you don't want any

113
00:04:49,925 --> 00:04:52,045
e-mails your way from

114
00:04:52,040 --> 00:04:54,980
source tree and et
cetera at lesson.

115
00:04:54,980 --> 00:04:57,350
Next thing you need to do is you

116
00:04:57,350 --> 00:04:59,900
need to create an
account on occasion,

117
00:04:59,900 --> 00:05:02,420
you can go to at
lysine and placing as

118
00:05:02,420 --> 00:05:04,280
the parent company
of source tree

119
00:05:04,280 --> 00:05:06,470
can go ahead and create
an account there,

120
00:05:06,470 --> 00:05:08,450
or you can use an
existing account

121
00:05:08,450 --> 00:05:10,400
if you already have a Gmail.

122
00:05:10,400 --> 00:05:13,570
I personally create
one using Gmail.

123
00:05:13,565 --> 00:05:15,595
It's much faster,
It's way easier

124
00:05:15,590 --> 00:05:19,770
and they don't spam you
with a lot of emails.

125
00:05:19,880 --> 00:05:21,950
Next thing in here,

126
00:05:21,950 --> 00:05:24,680
we are going to connect
it to an account.

127
00:05:24,680 --> 00:05:26,540
Now, this is, of course,

128
00:05:26,540 --> 00:05:28,190
we will not be doing this.

129
00:05:28,190 --> 00:05:31,100
If you want to host your code on

130
00:05:31,100 --> 00:05:33,940
a certain websites like
GitHub or Bitbucket.

131
00:05:33,935 --> 00:05:35,245
We will not be doing that,

132
00:05:35,240 --> 00:05:39,370
so you can simply click
here on skipped setup.

133
00:05:39,365 --> 00:05:42,625
Finally, while
installing source tree

134
00:05:42,620 --> 00:05:45,700
will tell you that it is
unable to locate get.

135
00:05:45,695 --> 00:05:47,995
So in order to complete this,

136
00:05:47,990 --> 00:05:50,710
simply click on Download
and embedded version

137
00:05:50,705 --> 00:05:54,175
of Git and continue on.

138
00:05:54,170 --> 00:05:56,360
And then it may also ask you

139
00:05:56,360 --> 00:05:58,400
for something
called a mercurial.

140
00:05:58,400 --> 00:06:03,070
Now, Mercurial is a different
system, just like get.

141
00:06:03,065 --> 00:06:07,135
It allows us to save different
versions of our project.

142
00:06:07,130 --> 00:06:08,750
We will not be using Mercurial,

143
00:06:08,750 --> 00:06:10,600
so you can simply click on,

144
00:06:10,595 --> 00:06:12,895
I don't want to download

145
00:06:12,890 --> 00:06:15,430
or I don't want
to use Mercurial.

146
00:06:15,425 --> 00:06:18,805
And this should be when
you finish installing.

147
00:06:18,800 --> 00:06:21,940
You should have this right here.

148
00:06:21,935 --> 00:06:24,145
And your, well, this window

149
00:06:24,140 --> 00:06:26,320
right here when you
start source tree,

150
00:06:26,315 --> 00:06:29,405
if you don't simply click
right here on Create and you

151
00:06:29,405 --> 00:06:32,575
should get this window.

152
00:06:32,570 --> 00:06:36,980
Now, this is where we actually
create our repository.

153
00:06:36,980 --> 00:06:38,390
And in here you can see that we

154
00:06:38,390 --> 00:06:39,970
have the destination path,

155
00:06:39,965 --> 00:06:41,945
the name, and the type

156
00:06:41,945 --> 00:06:44,075
of version control
that we want to use.

157
00:06:44,075 --> 00:06:45,845
Of course we'll
be using the GET.

158
00:06:45,845 --> 00:06:48,385
We also have the option
to create an account,

159
00:06:48,380 --> 00:06:51,290
but as I've told you, we're
keeping things very simple.

160
00:06:51,290 --> 00:06:52,580
It's our first time,

161
00:06:52,580 --> 00:06:55,700
so we will not be
creating any account.

162
00:06:55,700 --> 00:06:59,110
So here we are going
to choose which

163
00:06:59,105 --> 00:07:02,785
is the destination path
of our repository.

164
00:07:02,780 --> 00:07:04,790
So what, what is the project

165
00:07:04,789 --> 00:07:06,859
that we are actually going to

166
00:07:06,860 --> 00:07:12,560
be creating a repository
for subsequent versions of.

167
00:07:12,560 --> 00:07:15,650
Well, let's create
our first project

168
00:07:15,650 --> 00:07:17,780
that we are going to be using.

169
00:07:17,780 --> 00:07:22,310
So in here that's open
up the Unity Hub.

170
00:07:22,310 --> 00:07:25,390
And as you can see, we already
have Hello World that we

171
00:07:25,385 --> 00:07:28,735
don't in a previous video
that's click on New.

172
00:07:28,730 --> 00:07:32,070
And let's make sure
it's a 3D project.

173
00:07:32,074 --> 00:07:38,364
And this is going to
be our cyber spy 2087.

174
00:07:38,360 --> 00:07:41,240
Let's go ahead and
create this project.

175
00:07:41,240 --> 00:07:42,890
So click on Create.

176
00:07:42,890 --> 00:07:44,810
And I, of course,

177
00:07:44,810 --> 00:07:47,510
always using my magic of

178
00:07:47,510 --> 00:07:50,290
editing in order to
speed up this process.

179
00:07:50,285 --> 00:07:52,955
I'll see you on the other side.

180
00:07:53,020 --> 00:07:55,730
Okay, welcome back.

181
00:07:55,730 --> 00:07:58,520
So I hope everything
worked out for you.

182
00:07:58,520 --> 00:08:04,450
So now we have a new project
which is cyber spite 2087.

183
00:08:04,445 --> 00:08:07,135
So now that we have
our project created,

184
00:08:07,130 --> 00:08:09,410
we can actually go
ahead and get started

185
00:08:09,410 --> 00:08:12,130
with creating a repository.

186
00:08:12,125 --> 00:08:16,555
Now, if we go back into our
source tree right here,

187
00:08:16,550 --> 00:08:18,670
we can click on Browse

188
00:08:18,665 --> 00:08:22,105
and we can actually go
ahead into Unity projects.

189
00:08:22,100 --> 00:08:24,220
And you can see that we have

190
00:08:24,215 --> 00:08:29,495
a hello world and we have
a cyberspace by 2087.

191
00:08:29,495 --> 00:08:31,685
So let's select this folder.

192
00:08:31,685 --> 00:08:34,715
It will create a repository
under this name.

193
00:08:34,715 --> 00:08:36,505
If we hit Create,

194
00:08:36,500 --> 00:08:37,850
it will ask a problem.

195
00:08:37,850 --> 00:08:40,000
Don't worry about
it. Click on Yes.

196
00:08:39,995 --> 00:08:42,985
And voila, now we have actually

197
00:08:42,980 --> 00:08:45,950
started creating a repository.

198
00:08:45,950 --> 00:08:48,620
You have the staged
files right here.

199
00:08:48,620 --> 00:08:50,450
You have different
kinds of knobs.

200
00:08:50,450 --> 00:08:53,270
You don't need to worry
about any of them for now,

201
00:08:53,270 --> 00:08:55,960
just focus on the staged files,

202
00:08:55,955 --> 00:08:59,645
on staged files and
commit up here.

203
00:08:59,645 --> 00:09:02,785
Now, if we scroll down
in these onstage files,

204
00:09:02,780 --> 00:09:06,130
you can see that most of
them are from the library.

205
00:09:06,125 --> 00:09:07,585
We scroll down to the end,

206
00:09:07,580 --> 00:09:11,740
we can see some of them are
Tampa 10 or temporarily.

207
00:09:11,735 --> 00:09:13,135
We can see also that we have

208
00:09:13,130 --> 00:09:14,890
project settings and these are

209
00:09:14,885 --> 00:09:19,165
all the files that
we for our project.

210
00:09:19,160 --> 00:09:21,100
We also have assets in here

211
00:09:21,095 --> 00:09:23,695
for unity in the
scenes for example.

212
00:09:23,690 --> 00:09:26,390
So this is a repository which is

213
00:09:26,390 --> 00:09:29,590
a version of our
current project.

214
00:09:29,585 --> 00:09:33,185
Now, the problem here
is, as you can see,

215
00:09:33,185 --> 00:09:36,315
there are a ton
and ton of files,

216
00:09:36,319 --> 00:09:39,159
and B will not be
needing all of them.

217
00:09:39,155 --> 00:09:42,485
Well, actually we'll need
almost none of them.

218
00:09:42,485 --> 00:09:45,775
We will need only a
certain kind of files.

219
00:09:45,770 --> 00:09:48,110
So we want to be ignoring

220
00:09:48,110 --> 00:09:52,390
the library and the
temporary temporary files.

221
00:09:52,385 --> 00:09:55,465
Why is that? Well, let me
show you by opening up

222
00:09:55,460 --> 00:09:59,850
the directory of our project.

223
00:10:03,930 --> 00:10:08,230
Oh, okay, So this
is Cyberspace by

224
00:10:08,230 --> 00:10:11,980
2080 sevens directory
inside of Unity project,

225
00:10:11,980 --> 00:10:13,290
as you can see up here.

226
00:10:13,285 --> 00:10:14,715
So we have the assets,

227
00:10:14,710 --> 00:10:16,690
the library logs, packages,

228
00:10:16,690 --> 00:10:18,270
et cetera, and et cetera.

229
00:10:18,265 --> 00:10:21,885
Now, what is the temporary
folder and what is

230
00:10:21,880 --> 00:10:25,540
the library folder and why
don't we actually need them?

231
00:10:25,540 --> 00:10:29,050
So temporary is just
a way for unity to

232
00:10:29,050 --> 00:10:32,650
open up faster whenever
we start the project.

233
00:10:32,650 --> 00:10:36,150
And it's always created
whenever we open a project.

234
00:10:36,145 --> 00:10:38,415
So for example, if I
go into Unity right

235
00:10:38,410 --> 00:10:40,920
here and I actually close it,

236
00:10:40,915 --> 00:10:43,545
you'll see that the
temporary file.

237
00:10:43,545 --> 00:10:45,175
Will disappear.

238
00:10:45,170 --> 00:10:48,230
And even if we delete
the library right now,

239
00:10:48,230 --> 00:10:51,370
so let's go ahead and delete
this library entirely.

240
00:10:51,365 --> 00:10:53,005
If we go back into

241
00:10:53,000 --> 00:10:57,500
our Unity Hub and open
up cyber spy 287.

242
00:10:57,500 --> 00:10:59,440
As you can see right here,

243
00:10:59,435 --> 00:11:02,245
you saw that the library
has been created again

244
00:11:02,240 --> 00:11:05,440
and the temporary folder
has also been created.

245
00:11:05,435 --> 00:11:07,775
So of course, the project should

246
00:11:07,775 --> 00:11:10,345
take a bit more time
now to open up.

247
00:11:10,340 --> 00:11:12,370
But this is evidence that

248
00:11:12,365 --> 00:11:14,545
a library and the
temporary folders

249
00:11:14,540 --> 00:11:19,730
are not necessary for us to
always commit and stage.

250
00:11:19,730 --> 00:11:21,980
And what do I mean by stage?

251
00:11:21,980 --> 00:11:24,920
So whenever we
stage our folders,

252
00:11:24,919 --> 00:11:27,709
we actually create
a commit from them,

253
00:11:27,710 --> 00:11:29,660
any version of them.

254
00:11:29,660 --> 00:11:32,420
And library takes
up a lot of space.

255
00:11:32,420 --> 00:11:34,240
As you can see, if
we scroll down,

256
00:11:34,235 --> 00:11:36,955
it takes up most of
the space and we

257
00:11:36,950 --> 00:11:40,030
don't want any of them at all.

258
00:11:40,025 --> 00:11:42,565
So how should we proceed?

259
00:11:42,560 --> 00:11:43,850
Well, we can actually

260
00:11:43,850 --> 00:11:46,790
ignore all of the
folders that are under

261
00:11:46,790 --> 00:11:49,580
the library by simply
going and choosing

262
00:11:49,580 --> 00:11:52,970
any of the folders that
have library on them.

263
00:11:52,970 --> 00:11:54,550
Right-click on it.

264
00:11:54,545 --> 00:11:56,425
And in here you can
see that we have

265
00:11:56,420 --> 00:11:58,450
the option to
ignore one of them.

266
00:11:58,445 --> 00:12:00,185
So click on ignore.

267
00:12:00,185 --> 00:12:02,575
And in here you have option

268
00:12:02,570 --> 00:12:04,880
to ignore this exact filename,

269
00:12:04,880 --> 00:12:07,660
ignore all files
with this extension,

270
00:12:07,655 --> 00:12:11,375
or you can ignore everything
beneath a library,

271
00:12:11,374 --> 00:12:12,694
and this is what we want.

272
00:12:12,695 --> 00:12:14,765
So click on Okay.

273
00:12:14,765 --> 00:12:16,975
And as you can see,
everything under

274
00:12:16,970 --> 00:12:19,010
library has now been ignored,

275
00:12:19,010 --> 00:12:20,390
so we cannot stage it,

276
00:12:20,390 --> 00:12:23,460
so we cannot save it
to our newer version.

277
00:12:23,464 --> 00:12:24,804
And if you scroll up,

278
00:12:24,800 --> 00:12:27,470
you might have noticed
that we have a new folder

279
00:12:27,470 --> 00:12:30,640
in here that is the
dot git ignore.

280
00:12:30,635 --> 00:12:32,545
And when we click
on it on the right,

281
00:12:32,540 --> 00:12:35,470
you can see that it
has the library.

282
00:12:35,465 --> 00:12:37,595
And, and if we
double-click on it,

283
00:12:37,595 --> 00:12:41,695
we can actually open it
up in our notepad and in

284
00:12:41,690 --> 00:12:43,670
here we can add the
different files that

285
00:12:43,670 --> 00:12:46,070
we also want to ignore.

286
00:12:46,070 --> 00:12:49,430
So what are the files
that we want to ignore?

287
00:12:49,430 --> 00:12:53,780
Well, there are a ton and ton
of files, but thankfully,

288
00:12:53,780 --> 00:12:56,360
somebody has actually
gone through

289
00:12:56,360 --> 00:12:59,870
all these files and created
a list of everything

290
00:12:59,870 --> 00:13:02,330
that we can ignore
whenever creating

291
00:13:02,330 --> 00:13:06,290
version controls or
versions of our project.

292
00:13:06,289 --> 00:13:08,259
And in order to find that file,

293
00:13:08,255 --> 00:13:11,565
you can go again and to
Google or the front.

294
00:13:11,569 --> 00:13:14,649
Go ahead and search
dot git, ignore unity.

295
00:13:14,645 --> 00:13:16,915
And you should have
this link right

296
00:13:16,910 --> 00:13:19,820
here for the github.com.

297
00:13:19,820 --> 00:13:22,090
And it will be hosted on GitHub.

298
00:13:22,085 --> 00:13:23,795
If you open up this link,

299
00:13:23,795 --> 00:13:25,585
it will take you right here.

300
00:13:25,580 --> 00:13:27,830
So this is the dot
gitignore and it's

301
00:13:27,830 --> 00:13:30,310
the unity dot git ignore.

302
00:13:30,305 --> 00:13:33,725
And these are all the
files that we can ignore

303
00:13:33,725 --> 00:13:37,955
when creating versions
of our project.

304
00:13:37,955 --> 00:13:40,535
You can click on row right here,

305
00:13:40,535 --> 00:13:44,375
and it will open up
this window or tab.

306
00:13:44,375 --> 00:13:46,255
Let's go ahead and select all

307
00:13:46,250 --> 00:13:48,650
of them by clicking
on control a.

308
00:13:48,650 --> 00:13:50,960
We will copy all of this using

309
00:13:50,960 --> 00:13:53,540
control C. And we are going

310
00:13:53,540 --> 00:13:58,970
to paste it in here in our
dot gitignore notepad.

311
00:13:58,970 --> 00:14:03,110
And now we have the
gitignore notepad filled

312
00:14:03,110 --> 00:14:05,090
with all the files that we will

313
00:14:05,090 --> 00:14:07,450
not use for our positive 3.

314
00:14:07,445 --> 00:14:10,615
We will save that
using Control S.

315
00:14:10,610 --> 00:14:14,210
And now back in Unity or I
mean back in source tree,

316
00:14:14,210 --> 00:14:15,260
you can see that when we had

317
00:14:15,260 --> 00:14:18,770
the git ignore,
everything is ignored.

318
00:14:18,770 --> 00:14:21,230
We will stage all of that.

319
00:14:21,230 --> 00:14:23,090
And when we stage all of that,

320
00:14:23,090 --> 00:14:24,910
you can see that these
are the files that

321
00:14:24,905 --> 00:14:27,145
are going to be committed.

322
00:14:27,140 --> 00:14:30,350
And these would be our
initial commitment or

323
00:14:30,350 --> 00:14:35,410
our initial repository
version of the project.

324
00:14:35,405 --> 00:14:38,755
And usually whenever you
create your initial commit,

325
00:14:38,750 --> 00:14:41,030
we call this the initial.

326
00:14:41,030 --> 00:14:42,970
You can capitalize it,

327
00:14:42,965 --> 00:14:48,565
the initial, oops,
initial commit.

328
00:14:48,560 --> 00:14:51,820
And we click on
Commit right here.

329
00:14:51,815 --> 00:14:54,515
So now if you look on the left,

330
00:14:54,515 --> 00:14:57,115
you can see that we have
branches under here and

331
00:14:57,110 --> 00:14:59,800
we have the master branch.

332
00:14:59,795 --> 00:15:04,135
Congratulations, we have
created our first commitment.

333
00:15:04,130 --> 00:15:07,190
Very nice. Now, let me just

334
00:15:07,190 --> 00:15:10,720
show you how we will move
further down the line,

335
00:15:10,715 --> 00:15:12,895
even though this video
has been long enough.

336
00:15:12,890 --> 00:15:17,210
But I think we need to
get a proper foundation

337
00:15:17,210 --> 00:15:18,770
for source tree and

338
00:15:18,770 --> 00:15:22,120
version control as we
move through our project.

339
00:15:22,115 --> 00:15:25,325
So let's say we are in
our project right here.

340
00:15:25,325 --> 00:15:28,925
And let's go ahead and
create some kind of cubes.

341
00:15:28,925 --> 00:15:30,455
3d object.

342
00:15:30,455 --> 00:15:32,525
Right-click in the hierarchy.

343
00:15:32,525 --> 00:15:34,865
3d object, create a cube,

344
00:15:34,865 --> 00:15:36,535
and now we have a cube.

345
00:15:36,530 --> 00:15:38,480
Let's scale it up a bit.

346
00:15:38,480 --> 00:15:39,830
So scale it on the x,

347
00:15:39,830 --> 00:15:41,420
the y, and the z.

348
00:15:41,420 --> 00:15:42,140
Great.

349
00:15:42,140 --> 00:15:45,470
So now we have a
cube and our scene.

350
00:15:45,470 --> 00:15:47,690
And now if we go
into source tree,

351
00:15:47,690 --> 00:15:49,660
let's save that before we go.

352
00:15:49,655 --> 00:15:52,475
And it needs to save
it to a certain scene.

353
00:15:52,475 --> 00:15:54,755
So let's inside of scenes.

354
00:15:54,755 --> 00:15:56,945
This will be our sample scene.

355
00:15:56,945 --> 00:15:59,815
Sure. Sample scene,
yes, replace it.

356
00:15:59,810 --> 00:16:04,270
So we have this sample
scene back and source tree.

357
00:16:04,265 --> 00:16:06,595
Wait for it a bit,
and you can see that

358
00:16:06,590 --> 00:16:08,800
we have uncommitted changes.

359
00:16:08,795 --> 00:16:10,085
So if we click on them,

360
00:16:10,085 --> 00:16:12,565
you can see that the
on-stage files are

361
00:16:12,560 --> 00:16:15,920
changes inside of the scenes,

362
00:16:15,920 --> 00:16:17,650
which is the sample scene.

363
00:16:17,645 --> 00:16:20,995
And here you can look in
detail what we've created now.

364
00:16:20,990 --> 00:16:23,480
It's a bit weird right here,

365
00:16:23,480 --> 00:16:24,620
but if you look closely,

366
00:16:24,620 --> 00:16:26,960
you can see that we've
created box collider.

367
00:16:26,960 --> 00:16:29,270
And basically this
represents the cube

368
00:16:29,270 --> 00:16:31,880
that we've added to our scene.

369
00:16:31,880 --> 00:16:34,690
So let's go ahead and
stage all of that.

370
00:16:34,685 --> 00:16:37,825
We can click on
Commit right here and

371
00:16:37,820 --> 00:16:41,230
name this added a cube.

372
00:16:41,225 --> 00:16:43,135
Click on comment.

373
00:16:43,130 --> 00:16:45,200
And now in our master branch,

374
00:16:45,200 --> 00:16:47,230
you can see that we
have an initial commit

375
00:16:47,225 --> 00:16:49,345
which didn't have any cubed.

376
00:16:49,340 --> 00:16:51,470
And now in our added cube,

377
00:16:51,470 --> 00:16:54,770
we've added a cube.

378
00:16:54,770 --> 00:16:56,720
So congratulations.

379
00:16:56,720 --> 00:16:59,710
And as a final note,

380
00:16:59,705 --> 00:17:02,005
this may look a bit cumbersome.

381
00:17:02,000 --> 00:17:03,620
This may look a bit weird,

382
00:17:03,620 --> 00:17:06,470
but don't be afraid
this is very simple.

383
00:17:06,470 --> 00:17:10,970
And more importantly, it's
extremely important for us to

384
00:17:10,970 --> 00:17:15,500
understand as we move
through our project,

385
00:17:15,499 --> 00:17:17,809
create versions, versions of it.

386
00:17:17,810 --> 00:17:20,030
And if we ever make a mistake,

387
00:17:20,030 --> 00:17:21,800
we can actually go back by

388
00:17:21,800 --> 00:17:25,090
right-clicking in here,
reversing the commit.

389
00:17:25,085 --> 00:17:27,145
And yes, we can reverse

390
00:17:27,140 --> 00:17:29,840
the commit if we go
back and to unity,

391
00:17:29,840 --> 00:17:31,780
it will ask us for
a live reload.

392
00:17:31,775 --> 00:17:33,485
We wrote, we reload,

393
00:17:33,485 --> 00:17:36,625
and now we don't
have the cube or any

394
00:17:36,620 --> 00:17:39,920
game breaking mechanic that
we've added along the way.

395
00:17:39,920 --> 00:17:44,260
And now it's time
for your challenge.

396
00:17:44,255 --> 00:17:47,155
Your challenge is going
to be to download and

397
00:17:47,150 --> 00:17:50,540
setup source tree
and the ignore file.

398
00:17:50,540 --> 00:17:54,530
So download source tree and
stall and setup everything.

399
00:17:54,529 --> 00:17:57,249
Create your 3D
project in Unity Hub,

400
00:17:57,245 --> 00:18:00,415
setup a repository for
it and source tree,

401
00:18:00,410 --> 00:18:02,810
nor the library files and get

402
00:18:02,810 --> 00:18:06,080
the dot ignore file and
add it to your repository,

403
00:18:06,080 --> 00:18:07,760
create your first commit,

404
00:18:07,760 --> 00:18:10,000
and then create
your second commit.

405
00:18:09,995 --> 00:18:12,055
You can even go ahead and try to

406
00:18:12,050 --> 00:18:14,290
maybe play around with
a couple of things.

407
00:18:14,285 --> 00:18:17,665
Add a cube, reversed the
commit, see what happens.

408
00:18:17,660 --> 00:18:19,840
Get comfortable
with source tree.

409
00:18:19,835 --> 00:18:22,555
And if you're having
a bit of trouble,

410
00:18:22,550 --> 00:18:24,620
you can pause the
video on this list

411
00:18:24,620 --> 00:18:26,990
of things that you
need to create.

412
00:18:26,990 --> 00:18:28,790
And you can also always go

413
00:18:28,790 --> 00:18:30,410
back and watch the video and see

414
00:18:30,410 --> 00:18:32,270
how I made everything and

415
00:18:32,270 --> 00:18:34,240
follow along with
me step-by-step.

416
00:18:34,235 --> 00:18:38,165
So see you in just a bit.

