Difference between revisions of "Git/C2/Basic-commands-of-Git/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''Title of script:''' '''Basic commands of Git''' '''Author:''' Priya K '''Keywords:''' '''Video tutorial, Git repository, basic commands, staging area, SHA-1 hash''' {|...")
 
 
Line 24: Line 24:
  
 
| style="border:1pt solid #000000;padding:0.097cm;"| In this tutorial, we will learn about
 
| style="border:1pt solid #000000;padding:0.097cm;"| In this tutorial, we will learn about
 
  
 
* '''Git repository''' and
 
* '''Git repository''' and
 
* Some basic commands of '''Git'''.
 
* Some basic commands of '''Git'''.
 
 
  
 
|-
 
|-
Line 37: Line 34:
  
 
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial, I am using
 
| style="border:1pt solid #000000;padding:0.097cm;"| For this tutorial, I am using
 
  
 
* '''Ubuntu Linux 14.04'''  
 
* '''Ubuntu Linux 14.04'''  
Line 51: Line 47:
  
 
| style="border:1pt solid #000000;padding:0.097cm;"| To follow this tutorial
 
| style="border:1pt solid #000000;padding:0.097cm;"| To follow this tutorial
 
  
 
* You must have knowledge of running '''Linux '''commands on the '''Terminal.'''
 
* You must have knowledge of running '''Linux '''commands on the '''Terminal.'''
  
 
* If not, for relevant '''Linux '''<nowiki>tutorials, please visit our website. <<PAUSE>></nowiki>
 
* If not, for relevant '''Linux '''<nowiki>tutorials, please visit our website. <<PAUSE>></nowiki>
 
 
  
 
|-
 
|-
Line 65: Line 58:
  
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now we will see what is '''Git repository.'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now we will see what is '''Git repository.'''
 
  
 
* '''Git repository '''is a folder where all the data of our project will be stored.
 
* '''Git repository '''is a folder where all the data of our project will be stored.
Line 72: Line 64:
 
** Normal folder contains only files and directories.
 
** Normal folder contains only files and directories.
 
** But the '''Git repository '''contains set of files and directories, along with their complete history.
 
** But the '''Git repository '''contains set of files and directories, along with their complete history.
 
 
  
 
|-
 
|-
Line 92: Line 82:
 
You can create the directory wherever you want on your machine.
 
You can create the directory wherever you want on your machine.
  
 +
|-
 +
| style="border:1pt solid #000000;padding:0.097cm;"|
  
By default, we are in our '''Home '''directory.
+
| style="border:1pt solid #000000;padding:0.097cm;"| By default, we are in our '''Home '''directory.
  
  
Type,''' '''
+
Type,
  
 
'''mkdir space mywebpage''' and press''' Enter'''.
 
'''mkdir space mywebpage''' and press''' Enter'''.
Line 104: Line 96:
  
 
|-
 
|-
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' cd mywebpage''' and press''' Enter'''.
+
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' cd mywebpage''' >> press''' Enter'''.
| style="border:1pt solid #000000;padding:0.097cm;"| To go''' '''into this '''directory''', type''' '''
+
| style="border:1pt solid #000000;padding:0.097cm;"| To go into this '''directory''', type,
  
 
'''cd space mywebpage''' and press''' Enter'''.
 
'''cd space mywebpage''' and press''' Enter'''.
  
 
|-
 
|-
| style="border:1pt solid #000000;padding:0.097cm;"| Type''''' git init''''' and press''' Enter'''
+
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' git init''' >> press''' Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| To make '''mywebpage''' '''directory '''as the '''Git repository''', type''''' ''git space init''' and press''' Enter'''.
 
| style="border:1pt solid #000000;padding:0.097cm;"| To make '''mywebpage''' '''directory '''as the '''Git repository''', type''''' ''git space init''' and press''' Enter'''.
  
Line 133: Line 125:
 
|-
 
|-
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type''''' ''ls -a''' and press''' Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type''''' ''ls -a''' and press''' Enter'''
| style="border:1pt solid #000000;padding:0.097cm;"| To see the hidden folder, type''''' '''''
+
| style="border:1pt solid #000000;padding:0.097cm;"| To see the hidden folder, type
  
 
'''ls space hyphen a''' and press''' Enter'''.
 
'''ls space hyphen a''' and press''' Enter'''.
Line 139: Line 131:
 
|-
 
|-
 
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight the hidden files
 
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight the hidden files
| style="border:1pt solid #000000;padding:0.097cm;"| It shows the '''dot git '''folder'''.'''
+
| style="border:1pt solid #000000;padding:0.097cm;"| It shows the '''dot git '''folder.
  
  
Line 163: Line 155:
  
 
|-
 
|-
| style="border:1pt solid #000000;padding:0.097cm;"| <nowiki>Highlight priya[dot]</nowiki>[mailto:spoken@gmail.com spoken][mailto:spoken@gmail.com @][mailto:spoken@gmail.com gmail][mailto:spoken@gmail.com .][mailto:spoken@gmail.com com]
+
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight '''<nowiki>priya.spoken@gmail.com</nowiki>'''
| style="border:1pt solid #000000;padding:0.097cm;"| <nowiki>Here I have used priya[dot]</nowiki>[mailto:spoken@gmail.com spoken][mailto:spoken@gmail.com @][mailto:spoken@gmail.com gmail][mailto:spoken@gmail.com .][mailto:spoken@gmail.com com].
+
 
 +
| style="border:1pt solid #000000;padding:0.097cm;"| Here I have used '''<nowiki>priya[dot]spoken[at]gmail[dot]com</nowiki>'''
  
  
Line 216: Line 209:
  
  
| style="border:1pt solid #000000;padding:0.097cm;"| * Multiple repositories can be created in a single machine.
+
| style="border:1pt solid #000000;padding:0.097cm;"|  
 +
* Multiple repositories can be created in a single machine.
 +
 
 
* If you use '''hyphen hyphen global''' flag, the setting will be applied to all the repositories in the machine.  
 
* If you use '''hyphen hyphen global''' flag, the setting will be applied to all the repositories in the machine.  
  
 
* So, whenever you create a new '''Git repository,''' this setting will be applied, by default.
 
* So, whenever you create a new '''Git repository,''' this setting will be applied, by default.
 +
 
* If you want the identity only for a particular repository, then do not use '''hyphen hyphen global''' flag.  
 
* If you want the identity only for a particular repository, then do not use '''hyphen hyphen global''' flag.  
 
 
  
 
|-
 
|-
Line 236: Line 230:
 
|-
 
|-
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''git config --list''' and press '''Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''git config --list''' and press '''Enter'''
 
 
  
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''git space config space hyphen hyphen list''' and press '''Enter.'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''git space config space hyphen hyphen list''' and press '''Enter.'''
Line 243: Line 235:
 
|-
 
|-
 
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight name, email address and editor
 
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight name, email address and editor
| style="border:1pt solid #000000;padding:0.097cm;"| Now, you can see the editor name, email address and username.
+
| style="border:1pt solid #000000;padding:0.097cm;"| Now, you can see the '''editor name, email address''' and username.
  
  
Line 268: Line 260:
  
 
Type''''' ''gedit mypage.html''' '''& '''and press''' Enter'''
 
Type''''' ''gedit mypage.html''' '''& '''and press''' Enter'''
| style="border:1pt solid #000000;padding:0.097cm;"| Switch back to the '''terminal.''' Let me clear the prompt.
+
| style="border:1pt solid #000000;padding:0.097cm;"| Switch back to the '''terminal.''' Let me clear the '''prompt'''.
  
  
Now type''' '''
+
Now type
  
'''gedit space mypage.html space ampersand''' and press''' Enter'''.
+
'''gedit space mypage.html space ampersand'''.
  
  
Line 279: Line 271:
  
  
We use the & (ampersand) to free up the prompt.
+
We use the '''& (ampersand)''' to free up the '''prompt'''.
  
  
Line 310: Line 302:
 
|-
 
|-
 
| style="border:1pt solid #000000;padding:0.097cm;"| Switch back to the '''terminal >> '''Type''''' ''git add mypage.html''' and press''' Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Switch back to the '''terminal >> '''Type''''' ''git add mypage.html''' and press''' Enter'''
| style="border:1pt solid #000000;padding:0.097cm;"| Switch back to the '''terminal''' and type''''' '''''
+
| style="border:1pt solid #000000;padding:0.097cm;"| Switch back to the '''terminal''' and type
  
 
'''git space add space mypage.html''' and press '''Enter'''.
 
'''git space add space mypage.html''' and press '''Enter'''.
  
 
|-
 
|-
| style="border:1pt solid #000000;padding:0.097cm;"| Type''''' git status''''' and press''' Enter'''
+
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' git status''' >> press''' Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now we will check the current status of '''Git'''.
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now we will check the current status of '''Git'''.
  
  
So type''''' ''git space status''' and press''' Enter'''.
+
So type '''git space status''' and press''' Enter'''.
  
 
|-
 
|-
Line 350: Line 342:
  
  
Type''''' ''git status''' and press''' Enter'''
+
Type '''git status''' >> press''' Enter'''
  
  
Line 375: Line 367:
 
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 8:
 
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 8:
 
| style="border:1pt solid #000000;padding:0.097cm;"| Let us switch back to our slides to know more about '''Staging area'''.
 
| style="border:1pt solid #000000;padding:0.097cm;"| Let us switch back to our slides to know more about '''Staging area'''.
 
  
 
* '''Staging area''' is a file that stores information of the changes that need to be committed.
 
* '''Staging area''' is a file that stores information of the changes that need to be committed.
Line 381: Line 372:
 
* We will discuss more about '''commit''' in the upcoming tutorials.
 
* We will discuss more about '''commit''' in the upcoming tutorials.
 
* Older '''Git '''versions used the term''' index''' instead of''' staging area.'''
 
* Older '''Git '''versions used the term''' index''' instead of''' staging area.'''
 
 
  
 
|-
 
|-
Line 388: Line 377:
  
  
Type''''' ''git add mypage.html''' and press''' Enter'''
+
Type '''git add mypage.html''' >> press''' Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now, let us see how to add the new changes of the file, to the''' staging area'''.
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now, let us see how to add the new changes of the file, to the''' staging area'''.
  
  
Switch back to the''' terminal'''. Let me clear the prompt.
+
Switch back to the''' terminal'''. Let me clear the '''prompt'''.
  
  
Line 398: Line 387:
  
 
|-
 
|-
| style="border:1pt solid #000000;padding:0.097cm;"| Type''''' ''git status''' and press''' Enter'''
+
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''git status''' >> press''' Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| To check the '''Git '''status, type''' git space status''' and press''' Enter'''.
 
| style="border:1pt solid #000000;padding:0.097cm;"| To check the '''Git '''status, type''' git space status''' and press''' Enter'''.
  
Line 420: Line 409:
  
  
| style="border:1pt solid #000000;padding:0.097cm;"| * When we attain a particular stage in our work, we can save them in the '''repository'''.  
+
| style="border:1pt solid #000000;padding:0.097cm;"|  
 +
* When we attain a particular stage in our work, we can save them in the '''repository'''.  
 
* This is called '''commit'''.
 
* This is called '''commit'''.
* Each commit is saved with the information of username, email-id, date, time and commit message.
+
* Each '''commit''' is saved with the information of '''username, email-id, date, time''' and '''commit message'''.
 
+
 
+
  
 
|-
 
|-
Line 430: Line 418:
  
  
Open the terminal and type '''git commit''' and press '''Enter'''
+
Switch back to the terminal and type '''git commit''' >> press '''Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now let us see how to '''commit'''.
 
| style="border:1pt solid #000000;padding:0.097cm;"| Now let us see how to '''commit'''.
  
Line 445: Line 433:
  
  
| style="border:1pt solid #000000;padding:0.097cm;"| In the first line, I will type “'''Initial commit'''” as the commit message.  
+
| style="border:1pt solid #000000;padding:0.097cm;"| In the first line, I will type “'''Initial commit'''” as the '''commit message'''.  
  
  
Line 458: Line 446:
 
|-
 
|-
 
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight Initial commit
 
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight Initial commit
| style="border:1pt solid #000000;padding:0.097cm;"| In future, with this '''commit''' message, we can identify what we did till this stage.
+
| style="border:1pt solid #000000;padding:0.097cm;"| In future, with this '''commit message''', we can identify what we did till this stage.
  
 
|-
 
|-
Line 471: Line 459:
 
| style="border:1pt solid #000000;padding:0.097cm;"| You will see some details, such as
 
| style="border:1pt solid #000000;padding:0.097cm;"| You will see some details, such as
  
* The commit message  
+
* The '''commit message'''
 
* How many files we have changed
 
* How many files we have changed
 
* How many insertions we have done and  
 
* How many insertions we have done and  
 
* Name of the file.  
 
* Name of the file.  
 
 
  
 
|-
 
|-
Line 483: Line 469:
  
 
|-
 
|-
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' ''git log''''' and press '''Enter'''
+
| style="border:1pt solid #000000;padding:0.097cm;"| Type '''git log''' >> press '''Enter'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' git space log''' and press '''Enter.'''
 
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' git space log''' and press '''Enter.'''
  
Line 507: Line 493:
  
  
| style="border:1pt solid #000000;padding:0.097cm;"| * '''SHA-1 hash '''is a unique id of 40 alpha-numeric characters.
+
| style="border:1pt solid #000000;padding:0.097cm;"|  
 +
* '''SHA-1 hash '''is a unique id of 40 alpha-numeric characters.
 
* '''Git '''stores all the informations in its database by the '''hash value.'''
 
* '''Git '''stores all the informations in its database by the '''hash value.'''
  
 
* '''Git '''commits are identified by the '''SHA-1 hash'''
 
* '''Git '''commits are identified by the '''SHA-1 hash'''
 
* You will understand the importance of the '''SHA-1 hash '''in future tutorials
 
* You will understand the importance of the '''SHA-1 hash '''in future tutorials
 
 
  
 
|-
 
|-
Line 526: Line 511:
  
  
It shows the details of the '''commit''' such as author name, email address, date, time and the '''commit''' message, which we gave earlier.
+
It shows the details of the '''commit''' such as '''author name, email address, date, time''' and the '''commit message''', which we gave earlier.
  
  
Line 541: Line 526:
  
 
| style="border:1pt solid #000000;padding:0.097cm;"| Let us summarize.
 
| style="border:1pt solid #000000;padding:0.097cm;"| Let us summarize.
 
  
 
In this tutorial we have learnt about
 
In this tutorial we have learnt about
  
* Git repository and
+
* '''Git repository''' and
* Some basic commands of Git like '''git''' '''init,''' '''status, commit '''and''' log'''.
+
* Some basic commands of '''Git''' like '''git init, status, commit '''and''' log'''.
 
+
 
+
  
 
|-
 
|-
Line 559: Line 541:
 
* Create a '''directory''' in your machine and make it as a '''repository'''.
 
* Create a '''directory''' in your machine and make it as a '''repository'''.
 
* Create a text file and add some content into it.
 
* Create a text file and add some content into it.
 
 
* Add the file to the '''staging area '''of the '''Git repository.'''
 
* Add the file to the '''staging area '''of the '''Git repository.'''
 
* '''Commit''' the file to your '''repository''' and
 
* '''Commit''' the file to your '''repository''' and
 
* See the '''commit''' details using '''git log''' command.
 
* See the '''commit''' details using '''git log''' command.
 
 
  
 
|-
 
|-
Line 576: Line 555:
  
 
Pls download and watch it.
 
Pls download and watch it.
 
 
 
  
 
|-
 
|-
Line 593: Line 569:
  
 
For more details, please write to us.
 
For more details, please write to us.
 
 
 
  
 
|-
 
|-
Line 607: Line 580:
  
 
More information on this Mission is available at the following link.
 
More information on this Mission is available at the following link.
 
 
 
  
 
|-
 
|-

Latest revision as of 06:58, 30 May 2015

Title of script: Basic commands of Git

Author: Priya K

Keywords: Video tutorial, Git repository, basic commands, staging area, SHA-1 hash


Visual cue
Narration
Slide 1:


Welcome to the spoken tutorial on Basic commands of Git.
Slide 2:


In this tutorial, we will learn about
  • Git repository and
  • Some basic commands of Git.
Slide 3:


For this tutorial, I am using
  • Ubuntu Linux 14.04
  • Git 2.3.2. and
  • gedit Text Editor

You can use any editor of your choice.

Slide 4:


To follow this tutorial
  • You must have knowledge of running Linux commands on the Terminal.
  • If not, for relevant Linux tutorials, please visit our website. <<PAUSE>>
Slide 5:


Now we will see what is Git repository.
  • Git repository is a folder where all the data of our project will be stored.
  • It can be located on the local machine or on a remote machine
  • The difference between normal folder and a Git repository is:
    • Normal folder contains only files and directories.
    • But the Git repository contains set of files and directories, along with their complete history.
Press Ctrl+Alt+T to open terminal Now let us learn to create a Git repository in our local machine.


Press Ctrl+Alt+T keys to open the terminal.

Type mkdir mywebpage and press Enter


On my machine, I will create a directory for the Git repository, in my Home directory.


You can create the directory wherever you want on your machine.

By default, we are in our Home directory.


Type,

mkdir space mywebpage and press Enter.


So now, we have created a directory mywebpage in our Home directory.

Type cd mywebpage >> press Enter. To go into this directory, type,

cd space mywebpage and press Enter.

Type git init >> press Enter To make mywebpage directory as the Git repository, type git space init and press Enter.
Highlight the message “Initialized empty Git repository


You can see the message “Initialized empty Git repository”.


This indicates that Git is initialized successfully.

Highlight the path And this is the path where Git repository is created in our system.
After initialization, a hidden folder dot git will be created inside the mywebpage folder.
Type ls -a and press Enter To see the hidden folder, type

ls space hyphen a and press Enter.

Highlight the hidden files It shows the dot git folder.


Deleting this dot git folder will delete the whole repository.


So you should be very careful with this dot git folder.

Now we have to set our identity to Git.
Type git config --global user.email priya.spoken@gmail.com and press Enter


To set the email address, type

git space config space hyphen hyphen global space user dot email space priya[dot]spoken@gmail.com

and press Enter

Highlight priya.spoken@gmail.com Here I have used priya[dot]spoken[at]gmail[dot]com


You can use your own valid email address.

Type git config --global user.name spoken and press Enter To set the username, type

git space config space hyphen hyphen global space user dot name space Priya

and press Enter.

Highlight Priya I have used Priya as a username.


Please use your name instead of Priya.

Highlight the name and email address The name and the email address that we set are the identities of the person who is working on Git.
Type git config --global core.editor gedit and press Enter Next I will configure the gedit text editor to give the commit message.


Type git space config space hyphen hyphen global space core dot editor space gedit and press Enter.


Now gedit is configured to Git.

Highlight --global flag


Switch back to our slides


Here global flag is optional.


We will switch back to our slides to know more about global flag.

Slide 6:


  • Multiple repositories can be created in a single machine.
  • If you use hyphen hyphen global flag, the setting will be applied to all the repositories in the machine.
  • So, whenever you create a new Git repository, this setting will be applied, by default.
  • If you want the identity only for a particular repository, then do not use hyphen hyphen global flag.
Switch back to our terminal


Switch back to the terminal.


Now let us check the configuration details of the identity that we set earlier.

Type git config --list and press Enter Type git space config space hyphen hyphen list and press Enter.
Highlight name, email address and editor Now, you can see the editor name, email address and username.


<<PAUSE>>

Slide 7:


I will be using html files for demonstration.


You can use any file type of your choice.

For eg: text files or doc files.

Switch back to the terminal


Clear the prompt


Type gedit mypage.html & and press Enter

Switch back to the terminal. Let me clear the prompt.


Now type

gedit space mypage.html space ampersand.


If you are using another file, then give that filename instead of mypage.html.


We use the & (ampersand) to free up the prompt.


Now press Enter.

Copy and paste the code into the file


I will copy and paste some code into this file, from my Writer document, which I had saved earlier.


Likewise, add some content into your file.

Save the file Now, I will save my file.
So, I have an html file with some code in it.


Note: wherever I use mypage.html, you will have to replace it with your filename.


Next, we will ask Git to follow the file mypage.html

Switch back to the terminal >> Type git add mypage.html and press Enter Switch back to the terminal and type

git space add space mypage.html and press Enter.

Type git status >> press Enter Now we will check the current status of Git.


So type git space status and press Enter.

Highlight the message “new file: mypage.html You can see “new file: mypage.html”.


This means that Git has started following the changes made to this file mypage.html.


This is called “tracking”.

Come to mypage.html file Let us switch back to our file mypage.html.
Add few lines And add a few more lines of code to this file.


Like before, I will copy-paste from my Writer file.

Save and close the file Save and close the file.
Switch back to the terminal


Type git status >> press Enter


Then switch back to the terminal.


As before, to check the current status of Git, type

git space status and press Enter.

Highlight the message “Changes not staged for commit” and “modified: mypage.html It shows “Changes not staged for commit” and “modified: mypage.html”.


This means that the changes we made, have not been added to the staging area.

<<PAUSE>>
Slide 8: Let us switch back to our slides to know more about Staging area.
  • Staging area is a file that stores information of the changes that need to be committed.
  • The file contents should be added to the staging area before committing them.
  • We will discuss more about commit in the upcoming tutorials.
  • Older Git versions used the term index instead of staging area.
Switch back to the terminal


Type git add mypage.html >> press Enter

Now, let us see how to add the new changes of the file, to the staging area.


Switch back to the terminal. Let me clear the prompt.


Type git space add space mypage dot html and press Enter.

Type git status >> press Enter To check the Git status, type git space status and press Enter.
Highlight the message “Changes to be committed: Now you can see the message “Changes to be committed:


This means that the file has been added to the staging area and is ready to be committed.


<<PAUSE>>

Now we will freeze our code at this point.
Slide 9:


  • When we attain a particular stage in our work, we can save them in the repository.
  • This is called commit.
  • Each commit is saved with the information of username, email-id, date, time and commit message.


Switch back to the terminal and type git commit >> press Enter

Now let us see how to commit.


Switch back to the terminal and type git space commit and press Enter.

gedit text editor opens up automatically to get the commit message.
Type Initial commit


In the first line, I will type “Initial commit” as the commit message.


You can type any informative message that you want.


Here you can see some lines begin with hash. You can leave them as it is or you can delete them.


Please write the commit message before or after the hash line.

Highlight Initial commit In future, with this commit message, we can identify what we did till this stage.
Save and close the gedit Let me save and close the editor.
Highlight Initial Commit , 1 file changed, 11 insertions(+), and mypage.html


You will see some details, such as
  • The commit message
  • How many files we have changed
  • How many insertions we have done and
  • Name of the file.
Now let us see the commit details using git log command.
Type git log >> press Enter Type git space log and press Enter.


Highlight SHA-1 hash


We have only one commit in our repository.


It shows a unique ID which is called commit hash or SHA-1 hash.


Switch back to our slides to know more about SHA-1 hash.

Slide 10:


  • SHA-1 hash is a unique id of 40 alpha-numeric characters.
  • Git stores all the informations in its database by the hash value.
  • Git commits are identified by the SHA-1 hash
  • You will understand the importance of the SHA-1 hash in future tutorials


Highlight the name, email address, date and message


Let us come back to our terminal.


It shows the details of the commit such as author name, email address, date, time and the commit message, which we gave earlier.


<<PAUSE>>

With this, we come to the end of this tutorial.
Slide 11:


Let us summarize.

In this tutorial we have learnt about

  • Git repository and
  • Some basic commands of Git like git init, status, commit and log.
Slide 12:


As an assignment
  • Create a directory in your machine and make it as a repository.
  • Create a text file and add some content into it.
  • Add the file to the staging area of the Git repository.
  • Commit the file to your repository and
  • See the commit details using git log command.
Slide 13:

Acknowledgement

The video at the following link summarises the Spoken Tutorial project.


Pls download and watch it.

Slide 14:

Acknowledgement


The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass online tests.


For more details, please write to us.

Slide 15:

Acknowledgement

Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.


More information on this Mission is available at the following link.

This is Priya from IIT Bombay.


Thanks for joining.

Contributors and Content Editors

Nancyvarkey, Priyacst