Hello, the students in this lesson, we're going to learn how to create a local repository and how
to make your first comment.
First of all, I want to say that there are two ways to create a repository.
The first one is to create the new one locally.
The second option is to clone existing repository.
In this lesson, we are going to cover only the first option and the second option will be covered in
obsolescence.
One will learn what remote repositories are.
Our goal during this course is not to run thousands of fans to get comments that you want to use.
Instead, we are going to focus on practice and learn everything.
What you need for your current or the future job.
That's why most part of the lesson will spend practice in real life scenarios.
I will show you such main comments as it, get at it and get status.
Also in this lesson, I will tell what the branches will discuss different cases when to use different
comments with different attributes.
Let's start.
And the best way to understand this topic is to practice.
We are going to start from the creative git repository locally.
Here is our Dharma project.
Imagine that we have some source code here in SLC folder here in Benfold where we have compiled binary
files and we want to use it to track changes in these files.
Let's open the box here first.
Now let's initialize the repository.
Let's perform, get any common type, get in it and press enter.
Now you see that in parentheses there is a new word.
Master Master is a main branch.
What is a branch branches and I part of everyday development process.
Each branch contains a history of snapshots.
Technically, we may call these snapshots with other words.
Those are our comments during the development will switch branches to separate development of a new
task or a new feature, and after that we'll merge branches.
Master is our single and the main branch which we have right after repository creation.
How to do operations with branches.
We are going to learn in the next lessons after we executed.
Any comment don't get folder was created in our project.
It is hidden by default, so make sure you are enabled view of hidden folders and here it is.
You're going to have to change files here manually just in case you're interested.
You can investigate how it stores, configurations and the history of the project.
Now, when they have git repository initialized in our folder, we want to track changes in existing
files.
The first thing that you need to understand in this lesson is that files can exist in one of two states
tracked and untracked, ensured tracked files are files that were present in the last snapshot of your
files, those files that Keith is aware of, untracked files, files that are present in the work and
directory, but that were not in the last snapshot and are not in the staging area to tell you that
you want to track changes in file.
We need to execute git at command, git add comment adds files to the staging area.
Do remember first lesson when I told you about staging area?
That's the area where we place files that we want to commit.
We can add one file or multiple files.
For example, to have one file, I have to write the following git add license 60.
If I want to add multiple files, I can type space and type new file name.
For the sake of example.
Let it be read me dot M.G..
Now you can press enter.
The check, what is the status of your repository on which branch you are and whether there are states
changes to be committed, we have to type next gate comment gate status here.
I can see that two files were added to stage an error and the rest of the files were not, including
all files that are in directories been and SLC to clear get and so you can press control and L simultaneously.
Now this much better.
We can add multiple files with the help of the mask.
For example, if you want to add all files with Java extension, I need to type the following.
Get at asterisk dot Java asterisk here means files with any name, but that has Java extension.
Lets press enter.
We see here that line field is changed with carriage return and Lindfield characters.
Let's now check it status.
I use Arrow up key to check comments which have recently enter it.
Here is a status hypocenter and you see now your file is also added to the staging area.
By the way, in case you don't like such verbose status, you can use short version of git status.
Get Status Desh.
As you can see that there is a letter with a status is a files are added to the staging area modified
and not added.
If we want to add all files, we can just use dot like this git at DOT here.
Dot means all possible names and extensions and if we will check its status now, we are going to see
that now.
All files in my project are ready to be committed.
Now when all files are in stage staging error, let me commit these changes.
We have to type the next comment, get commit dash, am in it, commit in quotes and FLOC in this case
stands for message.
Each snapshot of our file system should have a message.
Usually this message is used to describe the changes that were made in scope of this that you can use
dash and flag because it is very convenient to live can it message in line with comit command.
In case you forgot to specify, dot and flag, the default text editor will be opened.
Let's use in line message command.
Usually the commit the message of the first commit is in it.
Commit press enter.
Hey, you see that you created a snapshot.
Let's check status.
And you can see that there is nothing to connect because there were no any other changes from the last
comment, let me clear console, by the way, in case you forget any comment, you always can ask it
to give you a hint.
There are two options.
The first option type help after comment that you want to use, for example, get status, double Desh
help.
And you can see that page from manual is open automatically in your Web browser.
Here you can find common description and all possible options how you can use this.
The second option is to type shortcut from help like this.
It's status Desh H.
And you're going to see a list of options that you can use with this comment right here in console.
One more thing that I wanted to show you in this lesson is how you can combine aid into states and commit
in one command, for example.
Let me do a modification in one of the source code files.
I will add one more space in some line.
Let's check shirt status.
And we see that we have one file.
Modify it.
Let me come in this file and adding it to the staging area simultaneously.
Just type the following gate comit, dash a dash cam, new changes and press enter get automatically
staged every file that is already tracked before doing the comit, letting you skip the part where we
have to add files to the staging area and perform it at command.
OK, now let's recap what we have learned today.
Today, we learned how to create local git repository.
You know what a branch is today.
You also understand the difference between tract and untracked files.
Together, we're told you to track files and added them to the staging area.
Now you know how to commit a snapshot of your files.
And also we learned how to request a hint from it and how to use help government.
That's all for today.
Thanks a lot for your attention and see you in the next lesson.