filmov
tv
Git and GitHub Beginner class 5: Git Tags what, why, when and how | Git | GitHub

Показать описание
Git Tags - what, why, when and how:
1. What are tags / releases:
- tagging in git or any other VCS refers to creating specific points in history for your repository/data
- this is usually done to mark release points
ex: your project is stable and marks to release1.0 you can create a tag for that
2. Why should i create TAGs
- To mark release points for your code/data
- to create historic restore point.
3. When to create TAGs
- when you want to create release point for a stable version of your code.
- when you want to create historic point for your code /data that you can refer at any futur time(to restore your data)
4. How to create TAGs in git
create | show | publish | delete
Step 1:
Checkout the branch where you want to create the tag
git checkout "branch name"
example : git checkout master
________________________________________________________
Step 2:
Create tag with some name
git tag "tag name"
example : git tag v1.0
git tag -a v1.0 -m "ver 1 of .." (to create annotated tags)
________________________________________________________
Step 3:
Display or Show tags
git tag
git show v1.0
git tag -l “v1.*”
________________________________________________________
Step 4:
Push tags to remote
git push origin v1.0
git push origin --tags
git push --tags
(to push all tags at once)
________________________________________________________
Step 5:
Delete tags (if required only)
to delete tags from local :
git tag -d v1.0
git tag --delete v1.0
to delete tags from remote :
git push origin -d v1.0
git push origin --delete v1.0
git push origin :v1.0
to delete multiple tags at once:
git tag -d v1.0 v1.1 (local)
git push origin -d v1.0 v1.1 (remote)
________________________________________________________
Checking out TAGS
We cannot checkout tags in git
We can create a branch from a tag and checkout the branch
git checkout -b "branch name" "tag name"
example : git checkout -b ReleaseVer1 v1.0
________________________________________________________
Creating TAGS from past commits
git tag "tag name" "reference of commit"
example : git tag v1.2 5fcdb03
1. What are tags / releases:
- tagging in git or any other VCS refers to creating specific points in history for your repository/data
- this is usually done to mark release points
ex: your project is stable and marks to release1.0 you can create a tag for that
2. Why should i create TAGs
- To mark release points for your code/data
- to create historic restore point.
3. When to create TAGs
- when you want to create release point for a stable version of your code.
- when you want to create historic point for your code /data that you can refer at any futur time(to restore your data)
4. How to create TAGs in git
create | show | publish | delete
Step 1:
Checkout the branch where you want to create the tag
git checkout "branch name"
example : git checkout master
________________________________________________________
Step 2:
Create tag with some name
git tag "tag name"
example : git tag v1.0
git tag -a v1.0 -m "ver 1 of .." (to create annotated tags)
________________________________________________________
Step 3:
Display or Show tags
git tag
git show v1.0
git tag -l “v1.*”
________________________________________________________
Step 4:
Push tags to remote
git push origin v1.0
git push origin --tags
git push --tags
(to push all tags at once)
________________________________________________________
Step 5:
Delete tags (if required only)
to delete tags from local :
git tag -d v1.0
git tag --delete v1.0
to delete tags from remote :
git push origin -d v1.0
git push origin --delete v1.0
git push origin :v1.0
to delete multiple tags at once:
git tag -d v1.0 v1.1 (local)
git push origin -d v1.0 v1.1 (remote)
________________________________________________________
Checking out TAGS
We cannot checkout tags in git
We can create a branch from a tag and checkout the branch
git checkout -b "branch name" "tag name"
example : git checkout -b ReleaseVer1 v1.0
________________________________________________________
Creating TAGS from past commits
git tag "tag name" "reference of commit"
example : git tag v1.2 5fcdb03