WEBVTT

0
00:00.360 --> 00:02.730
In this module, I want to introduce you

1
00:02.730 --> 00:04.590
to how Git works

2
00:04.590 --> 00:08.040
and how you can use it to achieve various powerful ends.

3
00:08.040 --> 00:09.390
And I'm going to be talking about

4
00:09.390 --> 00:12.060
and showing you how you can use Git

5
00:12.060 --> 00:16.500
on the command line to do things such as Version Control

6
00:16.500 --> 00:18.510
or how to Clone Repositories,

7
00:18.510 --> 00:22.200
how to Fork, make Pull Requests, and Merge Repositories

8
00:22.200 --> 00:24.870
and a whole bunch of really, really exciting things.

9
00:24.870 --> 00:28.590
So let's talk about Version Control in its simplest form.

10
00:28.590 --> 00:30.720
Let's say that I create a new code file

11
00:30.720 --> 00:32.640
and I write a few lines in it.

12
00:32.640 --> 00:36.180
Now I decide to put it under version control using Git

13
00:36.180 --> 00:39.600
and let's say that I call this save point number one.

14
00:39.600 --> 00:44.580
Now this is my first version, so later on as I progress

15
00:44.580 --> 00:47.490
I write maybe a few more lines of code.

16
00:47.490 --> 00:51.210
And at this point I decide to make another save point

17
00:51.210 --> 00:54.240
and I call this my second version.

18
00:54.240 --> 00:57.510
Further down the line, I accidentally screw up

19
00:57.510 --> 01:00.720
my entire code file and it's irreparable,

20
01:00.720 --> 01:01.980
and I get to the point

21
01:01.980 --> 01:05.220
where I would rather burn my entire code file

22
01:05.220 --> 01:08.430
rather than having to try and fix it.

23
01:08.430 --> 01:10.500
You do get into these situations

24
01:10.500 --> 01:12.690
because very often your code is interlinked

25
01:12.690 --> 01:14.940
and each class depends on another,

26
01:14.940 --> 01:17.250
and sometimes you can screw up

27
01:17.250 --> 01:19.620
in a way where you know all hope is lost,

28
01:19.620 --> 01:24.360
and I simply just want to roll back to the last save point.

29
01:24.360 --> 01:27.030
I can do that using Git.

30
01:27.030 --> 01:30.270
You can either compare your current code file,

31
01:30.270 --> 01:31.740
so the current mess that you've made,

32
01:31.740 --> 01:33.240
against a previous version,

33
01:33.240 --> 01:35.520
so at any of the save points before.

34
01:35.520 --> 01:38.370
Alternatively, you can simply just roll back

35
01:38.370 --> 01:40.230
to a previous version,

36
01:40.230 --> 01:41.430
and it doesn't have to be the one

37
01:41.430 --> 01:43.350
that was immediately previous.

38
01:43.350 --> 01:46.590
You can go as far back or as far forwards as you like,

39
01:46.590 --> 01:49.590
as long as you know which version you want.

40
01:49.590 --> 01:52.530
In the next lesson, I'm going to show you Version Control

41
01:52.530 --> 01:55.320
using Git locally on your computer,

42
01:55.320 --> 01:57.390
and we're going to use the command line to do this.

43
01:57.390 --> 01:58.953
So I'll see you there.