Hello everyone! It’s Ray.
As mentioned in my the article I posted last time, Git is kind of an integral tool to coders.
Today I’m going to share the basics of Git.
At the first, let’s create an example folder, it could be my-git-repository.
Le’t go to command line
cd the idea patch you like for this folder
to get into the folder in command line. Code is the name of my own folder, which is different from yours. Please type your own.
Now we are in the folder as follows:
Let’s make a file here
And then we add the content below in the file:
And then let’s type and take a look
As image shown above, now we could start to use git’s feature.
Currently the example1 is still untracked. Remember that before we make any commit, sounds like that we have to follow those celebrities before receiving what’s new of them.
Let’s add the file and start to track it
git add example1.html
As image below:
Okay. After tracking, now we are going to make our first commit.
as image below:
Supposedly, the new window would pop up as image below:
Now we enter the message for this commit for further better recognising.
it means save and exit this window
Now let’s type
, and it should look like image above.
, and you could see a series of number which represents the identify number of this commit.
Please note that the number varies out of the content of commit, so each commit is unique. If your commit number is different from mine, rest-assured that that’s pretty normal.
Now we’ve completed our very first commit, and we will be able to go back to this commit whenever we need in the future.
Okay. Let’s call it a day! I will bring more to you in the following days