#!/usr/bin/bash

# Create an empty repository
git init WorkingWithTags
cd       WorkingWithTags

# Create an executable shell script HelloWorld.sh
cat > HelloWorld.sh <<'EOF'
#!/usr/bin/bash

echo "Hello World"
EOF
chmod +x HelloWorld.sh

# First commit on master branch
git add HelloWorld.sh
git commit -m "Hello World"

# Creat an annotated tag
git tag -a v1.0 -m "Final version of Hello World"

# List tags
git tag

# Review history
git log

# Tags can be used as references to commits (e.g. in show command)
git show v1.0

# Delete a tag
git tag --delete v1.0

# Caution: Tags are not transferred to remote servers by default
