Git/C2/Tagging-in-Git/English
Title of script: Tagging in Git
Author: Priya K
Keywords: Video tutorial, tagging, annotated tag, lightweight tag
|
|
Slide 1: | Welcome to the spoken tutorial on Tagging in Git. |
lide 2: | In this tutorial, we will learn about
|
Slide 3:
|
For this tutorial, I am using
You can use any editor of your choice. |
Slide 4:
|
To follow this tutorial
|
Let us learn about tagging. | |
Slide 5
|
* Tagging is used to mark a commit stage as important.
|
Slide 6
|
There are two types of tags:
|
First I will demonstrate how to create a lightweight tag. | |
Press Ctrl+Alt+T to open the terminal | Let us go to our Git repository mywebpage which we created earlier. |
Type cd mywebpage and press Enter | Switch to the terminal and type:
|
I will continue to use html files for demonstration.
| |
Type git log --oneline | Let’s check the Git log by typing
git space log space hyphen hyphen oneline
|
Highlight the commits | Currently, we have three commits in our repository namely "Added colors, Added history and Initial commit". |
Highlight “Added colors”
|
Now I will create a lightweight tag in the latest commit “Added colors”.
|
Type git tag v1.1 and press Enter | Type git space tag space v1.1 and press Enter. |
Highlight v1.1 | Here I will give v1.1 as the tag name. You can give any name of your choice. |
Type git tag and press Enter | You can see the tag by typing git space tag and press Enter.
<<PAUSE>> |
Next we will learn how to create an annotated tag. | |
First I will make some modifications in the file mypage.html for demonstration purpose. | |
Type gedit mypage.html ampersand and press Enter
|
Type gedit space mypage.html space ampersand and press Enter.
|
Save and close the file | Then save and close the file. |
Let’s commit our work at this point. | |
Type git commit -am “Added content in mypage.html” and press Enter | Type git space commit space hyphen a m space
within double quotes “Added content in mypage.html”
|
Let us assume that this particular stage is very important to the project.
| |
Type git tag -a v1.2 -m “My Version 1.2” and press Enter
|
Here we will create an annotated tag.
|
Type git tag and press Enter
|
To see the tag list, type git space tag and press Enter.
|
Highlight v1.1
Highlight v1.2 |
Here v1.1 is the lightweight tag and v1.2 is the annotated tag.
|
We can see the difference between the two tags by using git show command. | |
Type git show v1.1 and press Enter | Type git space show space v1.1 and press Enter. |
Highlight commit details and file changes | Here we can see the complete details of the lightweight tag v1.1.
|
Type git show v1.2 and press Enter | Next, we will see the details of the annotated tag v1.2.
|
Highlight tag v1.2
Highlight Tagger and Date Highlight date and time Highlight Version 1.2 Highlight commit details Highlight file changes |
Here we can see the
|
Annotated tag is always recommended when you work collaboratively.
| |
Let us now learn how to mark a tag in our old commits. | |
Type git log --oneline and press Enter | First, we will check the Git log by typing
git space log space hyphen hyphen oneline
|
Type git tag -a v1.0 hash -m “My Version 1.0” and press Enter | Now for instance, I want to create a tag in my second commit “Added history.html”
|
Type git tag and press Enter | We will be able to see the tag which we created now, by typing git space tag and press Enter. |
Highlight v1.0 | You can see the tag v1.0 is created here. |
Next we will learn how to see the tags along with the Git log. | |
Type git log --oneline --decorate and press Enter | Type git space log space hyphen hyphen oneline space hyphen hyphen decorate and press Enter. |
You can see the Git log along with the tag names.
| |
Now, we will learn to delete an unwanted tag. | |
Highlight v1.1
Highlight hash |
Say, I want to delete the tag v1.1.
|
Type git tag and press Enter | We will check whether the tag is deleted or not.
|
With this, we come to the end of this tutorial. | |
Slide 7:
|
Let us summarize.
|
Slide 8:
|
As an assignment
|
Slide 9:
Acknowledgement |
The video at the following link summarises the Spoken Tutorial project.
|
Slide 10:
Acknowledgement |
The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass online tests.
|
Slide 11:
Acknowledgement
|
Spoken Tutorial Project is funded by NMEICT, MHRD, Government of India.
|
This is Priya from IIT Bombay. Thanks for joining. |