47 views

Create tag in git using Git GUI

Today, I will discuss about “Tag Creation in git”. There are two ways of doing it . One is through git repository itself and another is through local repository. In my today’s blog, I will discuss about the latter one.
Before we start on this topic, we need to understand why we need to create a tag . Assume, we have a release today and developers might be working on the code which may or may not be part of this release. Hence, we need to coordinate with the team and tell them that at particular hours(say at x PM ) , DevOps team will freeze the code. To put it differently, Tag will be created on that last commit. Once the tag is created, developers can’t add/change in that tag because DevOps Teams generally locks that Tag as well.Secondly, Tag information is not shared with the Developers.
Other side is ,developer can push their changes to the branch to which they were doing before , but those changes will not be part of that tag as tag is mapped to the particular commit. Post that commit, nothing is included in the tag.
Below are the steps to achieve the same.
STEP 1 : Go to Repository->Visualize “Sub-branch” History, where sub-branch is the branch name. See the below image for the same.


STEP 2 : I choose Sample.r file edited at Timestamp “2020-05-23 15:15:45”. See the below image for the same.

Right Click on that file , Click on “Create Tag”. Give a Name to the Tag.
Tag Naming Convention : T-$SYSDATE-$BRANCH_NAME where $SYSDATE is the Today’s date and $BRANCH_NAME is the name of the branch on which tag is created. Click on Create.



As soon as Tag is created , the same can be observed at that commit as well.



STEP 3 : Go to File->Start Git GUI



You will be at sub-branch. Now, Click on Push button.Below Screen will appear.



Check the “Include Tags” . We created Tag using sub-branch , that’s why I selected that branch. Click on Push. See the below image where it mentioned that Tag is pushed to git.



Check the same in git repository as well. See the below image where we can see Tag .





Related posts