In this lab, you're going to add tags to denote releases for your game.
As you make changes to your game, you'll want to tag released versions so that players can download a specific version of the game. This will allow you to easily track which version of the game is currently live and which version is in development. It will also help with troubleshooting and debugging issues that arise.
When you create tags, they point to specific commits. You can create tags for any commit, but it's common to create tags for commits that represent a released version of your game.
-
Open the terminal or command prompt
-
List the commits in your repository
git log --oneline
-
Copy the commit hash for the commit you want to tag
In this example, you would use the commit hash
f27298a.f27298a (HEAD -> main, origin/main) Add game rules to index.html 503d006 Add badges 6379deb Update dependencies 92f12c2 Add CI workflow d57f3f7 Add linting workflow 59012dc Add deploy-pages workflow ...
Create several tags so that developers can find the major, minor, and patch versions of the game.
-
Open the terminal or command prompt
-
Create an annotated tag
Make sure to replace
<sha>with the commit hash you copied in the previous step.git tag -a v1.0.0 -m "Release version 1.0.0" <sha>
-
Create lightweight tags for the major and minor versions
Make sure to replace
<sha>with the commit hash you copied in the previous step.git tag v1.0 <sha> git tag v1 <sha>
Later in this training, you'll learn about creating GitHub releases and how they interact with tags. For now, you'll simply push the tags to GitHub.
-
Open the terminal or command prompt
-
Push the tags to GitHub
git push --tags
-
Navigate to your repository on GitHub.com
-
Click the Code tab
-
Click the Tags button
-
Verify the tags are present
-
Click the v1.0.0 tag to view the annotated tag notes
If you're having trouble with any of the steps, you can ask for help in the meeting chat.

