1
00:00:00,360 --> 00:00:02,730
Instructor: In this module, I wanna introduce you

2
00:00:02,730 --> 00:00:04,590
to how Git works

3
00:00:04,590 --> 00:00:08,039
and how you can use it to achieve various powerful wins.

4
00:00:08,039 --> 00:00:09,390
And I'm gonna be talking about

5
00:00:09,390 --> 00:00:12,060
and showing you how you can use Git

6
00:00:12,060 --> 00:00:16,500
on the command line to do things such as version control

7
00:00:16,500 --> 00:00:18,510
or how to clone repositories,

8
00:00:18,510 --> 00:00:22,200
how to fork, make pull requests, and merge repositories

9
00:00:22,200 --> 00:00:24,870
and a whole bunch of really, really exciting things.

10
00:00:24,870 --> 00:00:28,590
So let's talk about version control in its simplest form.

11
00:00:28,590 --> 00:00:30,720
Let's say that I create a new code file

12
00:00:30,720 --> 00:00:32,640
and I write a few lines in it.

13
00:00:32,640 --> 00:00:36,180
Now I decide to put it under version control using Git

14
00:00:36,180 --> 00:00:39,600
and let's say that I call this save point number one.

15
00:00:39,600 --> 00:00:44,580
Now this is my first version, so later on as I progress

16
00:00:44,580 --> 00:00:47,490
I write maybe a few more lines of code.

17
00:00:47,490 --> 00:00:51,210
And at this point I decide to make another save point

18
00:00:51,210 --> 00:00:54,240
and I call this my second version.

19
00:00:54,240 --> 00:00:57,510
Further down the line, I accidentally screw up

20
00:00:57,510 --> 00:01:00,720
my entire code file and it's irreparable,

21
00:01:00,720 --> 00:01:01,980
and I get to the point

22
00:01:01,980 --> 00:01:05,220
where I would rather burn my entire code file

23
00:01:05,220 --> 00:01:08,430
rather than having to try and fix it.

24
00:01:08,430 --> 00:01:10,500
You do get into these situations

25
00:01:10,500 --> 00:01:12,690
because very often your code is interlinked

26
00:01:12,690 --> 00:01:14,940
and each class depends on another.

27
00:01:14,940 --> 00:01:17,250
And sometimes you can screw up

28
00:01:17,250 --> 00:01:19,620
in a way where you know all hope is lost

29
00:01:19,620 --> 00:01:24,360
and I simply just want to roll back to the last save point.

30
00:01:24,360 --> 00:01:27,030
I can do that using Git.

31
00:01:27,030 --> 00:01:30,270
You can either compare your current code file,

32
00:01:30,270 --> 00:01:31,740
so the current mess that you've made,

33
00:01:31,740 --> 00:01:33,240
against a previous version,

34
00:01:33,240 --> 00:01:35,520
so at any of the save points before.

35
00:01:35,520 --> 00:01:38,370
Alternatively, you can simply just roll back

36
00:01:38,370 --> 00:01:40,230
to a previous version,

37
00:01:40,230 --> 00:01:41,430
and it doesn't have to be the one

38
00:01:41,430 --> 00:01:43,350
that was immediately previous.

39
00:01:43,350 --> 00:01:46,590
You can go as far back or as far forwards as you like,

40
00:01:46,590 --> 00:01:49,590
as long as you know which version you want.

41
00:01:49,590 --> 00:01:52,530
In the next lesson, I'm gonna show you version control

42
00:01:52,530 --> 00:01:55,320
using Git locally on your computer,

43
00:01:55,320 --> 00:01:57,390
and we're gonna use the command line to do this.

44
00:01:57,390 --> 00:01:58,953
So I'll see you there.

