1 00:00:04,049 --> 00:00:06,479 The first thing we're going to do is create a directory for our 2 00:00:06,479 --> 00:00:09,269 project. You can call this directory anything and put it 3 00:00:09,299 --> 00:00:12,539 anywhere on your machine, it doesn't matter. I'm currently in 4 00:00:12,539 --> 00:00:16,439 the projects directory. So let's create a directory called moon, 5 00:00:17,039 --> 00:00:20,399 and then go into this directory. So let's imagine this is our 6 00:00:20,399 --> 00:00:23,609 project directory. and here we can have 10s, or hundreds of 7 00:00:23,609 --> 00:00:24,059 files. 8 00:00:24,389 --> 00:00:26,849 The first time we want to add this file to a git repository, 9 00:00:27,089 --> 00:00:27,359 we have 10 00:00:27,370 --> 00:00:31,860 to initialize a new empty repository. So we type Git in 11 00:00:31,860 --> 00:00:35,280 it, look at this message, initialized, empty Git 12 00:00:35,280 --> 00:00:38,790 repository in and here's the full path. So we have the moon 13 00:00:38,790 --> 00:00:41,310 directory. And inside this directory, we have a 14 00:00:41,310 --> 00:00:44,910 subdirectory called dot Git. And, by default, this 15 00:00:44,910 --> 00:00:47,490 subdirectory is hidden because you're not supposed to touch it. 16 00:00:47,940 --> 00:00:53,040 So if we type ls to list all the files and directories here, we 17 00:00:53,040 --> 00:00:56,850 don't see anything. But if you type ls dash A, which is short 18 00:00:56,850 --> 00:01:01,200 for all, we can see the Git sub directory If you're on Mac, you 19 00:01:01,200 --> 00:01:04,260 can open this with Finder. And if you're on Windows, you can 20 00:01:04,290 --> 00:01:07,590 open it with Windows Explorer or File Explorer. I'm not sure why 21 00:01:07,590 --> 00:01:12,900 it's called these days. So let's open .git take a look. 22 00:01:14,880 --> 00:01:18,450 So here's our Git directory or Git repository. This is where 23 00:01:18,450 --> 00:01:21,630 Git stores information about our project history. So we have 24 00:01:21,630 --> 00:01:25,710 directories like branches, hooks, info, objects, and 25 00:01:25,710 --> 00:01:28,830 references. Now someone using Git, you don't really need to 26 00:01:28,830 --> 00:01:32,040 understand this structure. This is purely implementation detail. 27 00:01:32,160 --> 00:01:35,100 It's how Git stores information. It's none of our business. 28 00:01:35,460 --> 00:01:38,430 That's why this directory is hidden so you don't touch it. If 29 00:01:38,430 --> 00:01:40,710 you corrupt or remove this directory, you're gonna lose 30 00:01:40,710 --> 00:01:43,710 your project history. Let me show you. So back in the 31 00:01:43,710 --> 00:01:47,670 terminal, look at this green marker. It says Git that means 32 00:01:47,670 --> 00:01:50,550 we have a git repository in this directory. Now if you want to 33 00:01:50,550 --> 00:01:53,820 have a pretty colorful terminal window like this on mac you need 34 00:01:53,820 --> 00:01:57,390 to install zelis H or z shell and on Windows, you need to 35 00:01:57,390 --> 00:02:01,260 install poshkit but don't worry about it. Now, these tools are 36 00:02:01,260 --> 00:02:04,170 completely optional to use. Git is just for making things 37 00:02:04,170 --> 00:02:07,560 pretty. So here we have a git repository. Now, if I remove the 38 00:02:07,560 --> 00:02:12,180 Git subdirectory, we're going to lose this repository. So RM dash 39 00:02:12,270 --> 00:02:17,460 RF .Git, look, the green mar er is gone. We don't have a git 40 00:02:17,460 --> 00:02:21,180 repository here anymore. So don t touch this directory. Now once 41 00:02:21,180 --> 00:02:26,130 again, let's initialize a Git repository. Beautiful. So now 42 00:02:26,160 --> 00:02:28,830 that we have a repository. Next we're going to talk about the 43 00:02:28,830 --> 00:02:30,150 basic Git workflow.