1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-16 11:45:04 +02:00

Merge pull request #1490 from volcov/add-git-tag-info

[git/en]add documentation about git tags
This commit is contained in:
Levi Bostian
2015-10-14 09:33:53 -05:00

View File

@@ -5,6 +5,7 @@ contributors:
- ["Jake Prather", "http://github.com/JakeHP"] - ["Jake Prather", "http://github.com/JakeHP"]
- ["Leo Rudberg" , "http://github.com/LOZORD"] - ["Leo Rudberg" , "http://github.com/LOZORD"]
- ["Betsy Lorton" , "http://github.com/schbetsy"] - ["Betsy Lorton" , "http://github.com/schbetsy"]
- ["Bruno Volcov", "http://github.com/volcov"]
filename: LearnGit.txt filename: LearnGit.txt
--- ---
@@ -76,6 +77,11 @@ other repositories, or not!
A branch is essentially a pointer to the last commit you made. As you go on A branch is essentially a pointer to the last commit you made. As you go on
committing, this pointer will automatically update to point the latest commit. committing, this pointer will automatically update to point the latest commit.
### Tag
A tag is a mark on specific point in history. Typically people use this
functionality to mark release points (v1.0, and so on)
### HEAD and head (component of .git dir) ### HEAD and head (component of .git dir)
HEAD is a pointer that points to the current branch. A repository only has 1 *active* HEAD. HEAD is a pointer that points to the current branch. A repository only has 1 *active* HEAD.
@@ -206,6 +212,28 @@ $ git branch -m myBranchName myNewBranchName
$ git branch myBranchName --edit-description $ git branch myBranchName --edit-description
``` ```
### tag
Manage your tags
```bash
# List tags
$ git tag
# Create a annotated tag
# The -m specifies a tagging message,which is stored with the tag.
# If you dont specify a message for an annotated tag,
# Git launches your editor so you can type it in.
$ git tag -a v2.0 -m 'my version 2.0'
# Show info about tag
# That shows the tagger information, the date the commit was tagged,
# and the annotation message before showing the commit information.
$ git show v2.0
# Push a single tag to remote
$ git push origin v2.0
# Push a lot of tags to remote
$ git push origin --tags
```
### checkout ### checkout
Updates all files in the working tree to match the version in the index, or specified tree. Updates all files in the working tree to match the version in the index, or specified tree.