Git tags are an easy way to track the versions of our application. In this recipe, we'll learn how to tag our Git repositories and then deploy specific versions to Heroku.
To start, let's open up a terminal and navigate to one of our Heroku apps by performing the following steps:
We can add our first tag with the
git tag
command. We'll need to specify the tag as well as a message that describes it:$ git tag -a v1.0 -m "Version 1 release. Example of a release tag"
Next, we'll want to push our new tag up to our origin repository:
$ git push—tags origin Counting objects: 1, done. Writing objects: 100% (1/1), 187 bytes | 0 bytes/s, done. Total 1 (delta 0), reused 0 (delta 0) To https://github.com/mscoutermarsh/refinery_heroku.git * [new tag] v1.0 -> v1.0
If we're using GitHub to host our repository, we will now see a new tag under the Releases section.