Difference between revisions of "Git/C2/Tagging-in-Git/English"
(Created page with "'''Title of script:''' '''Tagging in Git''' '''Author:''' Priya K '''Keywords:''' '''Video tutorial, tagging, annotated tag, lightweight tag''' {| style="border-spacing:0...") |
Nancyvarkey (Talk | contribs) |
||
Line 18: | Line 18: | ||
| style="border:1pt solid #000000;padding:0.097cm;"| lide 2: | | style="border:1pt solid #000000;padding:0.097cm;"| lide 2: | ||
| 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 | ||
− | |||
− | |||
* '''Tagging''' and | * '''Tagging''' and | ||
* Types of '''tagging''' | * Types of '''tagging''' | ||
− | |||
− | |||
|- | |- | ||
Line 31: | Line 27: | ||
| 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''' | ||
* '''Git 2.3.2''' and | * '''Git 2.3.2''' and | ||
Line 40: | Line 35: | ||
|- | |- | ||
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 4: | | style="border:1pt solid #000000;padding:0.097cm;"| Slide 4: | ||
− | |||
− | |||
| 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''' Terminal'''. | * You must have knowledge of running''' Linux''' commands on''' Terminal'''. | ||
* If not, for relevant''' Linux''' tutorials, please visit our website. | * If not, for relevant''' Linux''' tutorials, please visit our website. | ||
− | |||
− | |||
|- | |- | ||
Line 59: | Line 49: | ||
− | | style="border:1pt solid #000000;padding:0.097cm;"| * '''Tagging''' is used to mark a '''commit''' stage as important. | + | | style="border:1pt solid #000000;padding:0.097cm;"| |
+ | * '''Tagging''' is used to mark a '''commit''' stage as important. | ||
* We can '''tag''' a '''commit,''' like a bookmark, for future references. | * We can '''tag''' a '''commit,''' like a bookmark, for future references. | ||
* Typically, this is used to mark release point of a project such as v1.0. | * Typically, this is used to mark release point of a project such as v1.0. | ||
− | |||
− | |||
|- | |- | ||
Line 71: | Line 60: | ||
| style="border:1pt solid #000000;padding:0.097cm;"| There are two types of '''tags''': | | style="border:1pt solid #000000;padding:0.097cm;"| There are two types of '''tags''': | ||
− | |||
* '''Lightweight tag''' and | * '''Lightweight tag''' and | ||
* '''Annotated tag''' | * '''Annotated tag''' | ||
− | |||
− | |||
|- | |- | ||
Line 110: | Line 96: | ||
|- | |- | ||
| style="border:1pt solid #000000;padding:0.097cm;"| Highlight the commits | | style="border:1pt solid #000000;padding:0.097cm;"| Highlight the commits | ||
− | | style="border:1pt solid #000000;padding:0.097cm;"| Currently, we have three commits in our '''repository '''namely''' "Added colors, Added history '''and''' Initial commit"'''. | + | | style="border:1pt solid #000000;padding:0.097cm;"| Currently, we have three commits in our '''repository '''namely''' "Added colors, Added history.html '''and''' Initial commit"'''. |
|- | |- | ||
Line 189: | Line 175: | ||
− | Type''' git space tag space hyphen a space v1.2 space hyphen m space '''within | + | Type''' git space tag space hyphen a space v1.2 space hyphen m space '''within double quotes''' “My Version 1.2”''' and press''' Enter'''. |
Line 199: | Line 185: | ||
|- | |- | ||
| style="border:1pt solid #000000;padding:0.097cm;"| Type''' git tag''' and press''' Enter''' | | style="border:1pt solid #000000;padding:0.097cm;"| Type''' git tag''' and press''' Enter''' | ||
− | |||
Line 229: | Line 214: | ||
− | It simply shows the '''commit''' details and file changes. | + | It simply shows the '''commit''' details and the file changes. |
|- | |- | ||
Line 254: | Line 239: | ||
* '''tag''' name | * '''tag''' name | ||
* '''tagger''' details | * '''tagger''' details | ||
− | * date the commit was tagged | + | * date the '''commit''' was '''tagged''' |
* '''tag''' message | * '''tag''' message | ||
* '''commit''' details and | * '''commit''' details and | ||
* file changes. | * file changes. | ||
− | |||
− | |||
|- | |- | ||
Line 337: | Line 320: | ||
− | It shows the message '''“Deleted tag 'v1.1'”''' and its commit hash. | + | It shows the message '''“Deleted tag 'v1.1'”''' and its '''commit hash.''' |
|- | |- | ||
Line 358: | Line 341: | ||
|- | |- | ||
| style="border:1pt solid #000000;padding:0.097cm;"| Slide 7: | | style="border:1pt solid #000000;padding:0.097cm;"| Slide 7: | ||
− | |||
| 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 | ||
− | |||
* '''Tagging''' and | * '''Tagging''' and | ||
* Types of '''tagging''' | * Types of '''tagging''' | ||
− | |||
− | |||
|- | |- | ||
| 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;"| As an assignment | | style="border:1pt solid #000000;padding:0.097cm;"| As an assignment | ||
− | |||
* Create a''' lightweight tag''' and an''' annotated tag''' and | * Create a''' lightweight tag''' and an''' annotated tag''' and | ||
* Understand the difference between both the '''tags''' | * Understand the difference between both the '''tags''' | ||
− | |||
− | |||
|- | |- |
Latest revision as of 17:40, 14 July 2015
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
|
|
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.html 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.
In this tutorial, we have learnt about
|
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. |