WEBVTT

00:06.380 --> 00:12.670
Let's create a directory where we'll store the files for our project.

00:12.680 --> 00:17.310
To create a directory, let's use MK Dir command.

00:17.330 --> 00:20.340
Let's run it with the name of the directory.

00:20.360 --> 00:28.400
I'll run MK Dear Demo and to change the Active Directory to the newly created one.

00:28.430 --> 00:31.040
I'll type SID demo.

00:31.070 --> 00:37.790
These two commands work on all operating systems Windows, Mac, iOS or Linux.

00:37.820 --> 00:42.110
Now we can also refer to it as a repository.

00:42.140 --> 00:50.570
This directory will contain all the files and since we are in the repository we need to initiate gear

00:50.600 --> 00:52.820
to start using it.

00:52.850 --> 00:55.740
To do this we'll run the following command.

00:55.760 --> 00:59.660
Git in it by the way for you to know.

00:59.660 --> 01:03.020
Just like getting it all git commands.

01:03.020 --> 01:08.300
Begin with the keyword git and followed by the command.

01:08.330 --> 01:14.660
Let's check this repository with the ls command tile type ls dash la.

01:14.690 --> 01:18.990
Notice this newly created dot git directory.

01:19.010 --> 01:27.740
All information related to get is stored in this directory, in this repository and this dot git directory

01:27.740 --> 01:31.460
and its contents are normally hidden from view.

01:31.460 --> 01:39.160
And the only thing you should know that it is there never added any files in this dot git directory.

01:39.170 --> 01:41.800
It can corrupt the whole repository.

01:41.810 --> 01:48.550
So now when we've initialized git, let's add a few files to our repository.

01:48.560 --> 01:55.880
You can add any files to this repository which you consider are good for your learning process.

01:55.910 --> 01:59.170
As for me, for now, I'll add one file.

01:59.180 --> 02:01.900
I'll type Dutch file one.

02:01.910 --> 02:05.230
This Dutch command will create an empty file.

02:05.240 --> 02:12.040
Now, when something is changed in our repository, let's see how good reacts to it.

02:12.050 --> 02:14.440
Let's type git status.

02:14.450 --> 02:20.500
You have to remember this command because it is one of the most used git commands.

02:20.510 --> 02:24.010
This command shows the status of your repository.

02:24.020 --> 02:32.900
It also provides such information as files which are untracked, which are tracked and what changes

02:32.900 --> 02:39.860
are and which is the current branch and what is the status of the current branch.

02:39.860 --> 02:45.440
So you should use this git status command very often.

02:45.440 --> 02:52.490
Now get have to know which files to track or which files should be untracked.

02:52.490 --> 02:59.960
If you decide to track the file with Git, it will monitor the changes being made to that file.

02:59.960 --> 03:06.470
And on the other hand, the changes to an entourage file are ignored by git.

03:06.500 --> 03:14.810
Now checking the status of our repository, we can see that one file is currently marked in red and

03:14.810 --> 03:16.160
it is on direct.

03:16.160 --> 03:25.190
In order to track this file or files, we can run the following command git add file one in case you

03:25.190 --> 03:32.780
want to add the whole directory or the whole repository, you have to run the following command git

03:32.780 --> 03:42.290
add dot or git at dash capital A it will tell it to track the current directory as well as any files

03:42.290 --> 03:45.890
or subdirectories within the current directory.

03:45.920 --> 03:54.300
Be aware of using this command because you can end up adding unnecessary files to your repository.

03:54.320 --> 04:01.550
Now when we set to get that, we want some files to be tracked and we added these files.

04:01.550 --> 04:10.670
We are ready to make a commit, commit to the sort of a snapshot or a state of your repository.

04:10.670 --> 04:13.850
In a particular moment of time.

04:13.850 --> 04:23.450
You can revert to this snapshot whenever you want and get back to the exact version of this file with

04:23.450 --> 04:25.880
all the changes if you need to.

04:25.910 --> 04:28.880
So let's run the following command.

04:28.910 --> 04:30.980
Git commit dash.

04:30.980 --> 04:31.580
Hm.

04:31.580 --> 04:39.920
And the command concerning this commit This dash am option specifies that you are going to add a message

04:39.920 --> 04:45.160
for you to know what changes were made to this commit.

04:45.170 --> 04:50.690
For example, in my case I'll write git commit the same added file.

04:50.690 --> 04:59.210
One Please note that a min and full commit message is an essential part of your commit and it will be

04:59.210 --> 05:05.840
important in the future for you or someone else to know why you created this commit.

05:06.160 --> 05:15.100
Some files will read it or some changes to the project were made after running git commit command.

05:15.130 --> 05:19.900
Please notice the string with letters and digits.

05:19.900 --> 05:24.320
It's the hash of the commit or its identity.

05:24.340 --> 05:31.780
This hash is a unique identifier and signature for each command generated automatically by git.

05:31.780 --> 05:37.570
And you can refer to this particular commit by using this hash.

05:37.600 --> 05:46.510
Next up, we'll take a look at how we could use remote repository and how to copy your files to this

05:46.510 --> 05:56.500
remote repository which will enable you to work in a team or others can access this repository and make

05:56.530 --> 05:57.370
use of it.
