Git Tagging
Instructions for git tag
Git tagging is a vital part of a professional work flow. We need a way to identify a group of files at a given point in time for many reasons. When we release software to our users we need to know exactly what was release. Since code is being change constantly it would be impossible to keep track of releases without version control. Git has the ability to label a group of files at a point in time. This is like a checkpoint or a saved copy of the project. We will use tags to identify completed unit/project work.
The command used is git tag
with some arguments. Here's an example of how you might tag your Project 1.
$ git tag -a v1.0-project1 -m "project 1 complete"
git tag
is the command.-a
means that this will be an annotated tag that saves more information than other forms of a tag.v1.0-project1
is the tag name.- v1.0 is the project number and version.
- If you need to push multiple versions of the same project, version it as v1.1, v1.2, v.1.3, etc.
-m "project 1 complete"
is the tag message. It will be seen when the tags are listed and helps find the tag you need.
After you create the tag you will need to push the tag to GitHub. Tags are not automatically sent with a normal push. You need to run this command:
$ git push origin --tags
This will push any tags made locally to the remote git repository.
You will need to run this every time you create a new tag.
You can create as many tags as you want but the important ones are for the project reviews.
Showing the tag
To view your tag you use this command:
git show v1.0-project1
That will produce output something like this:
student@ubuntu:~/projects$ git show v1.0.1
tag v1.0.1
Tagger: Eric Knapp <eknapp@madisoncollege.edu>
Date: Sun Feb 11 16:43:17 2018 -0600
project 1.0.1
commit 62968891d31def2077cc3939d97ff452dfce5b0b (tag: v1.0.1, origin/master, master)
Author: Eric Knapp <eknapp@madisoncollege.edu>
Date: Sun Feb 11 16:39:46 2018 -0600
Adding a filter for # files in the git ignore file. Moving the finished analyzer files back in place. Adding demos for Sets.
...