# Pulling Git Version Semantic tag into Project

**URL:** <https://forum.inductiveautomation.com/t/pulling-git-version-semantic-tag-into-project/112353>\
**Category:** Ignition\
**Tags:** ignition83, perspective\
**Created:** [November 21, 2025, 9:33am UTC](https://forum.inductiveautomation.com/t/pulling-git-version-semantic-tag-into-project/112353 "2025-11-21T09:33:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Simpson](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Craig\_Simpson](https://forum.inductiveautomation.com/u/Craig_Simpson)\
**Post date:** [November 21, 2025, 9:33am UTC](https://forum.inductiveautomation.com/t/pulling-git-version-semantic-tag-into-project/112353/1 "2025-11-21T09:33:23Z")

</div>

Apologies if I have missed any other posts on this.

Using Perspective, 8.3.1. Windows server 2022.

I am using GitHub as SCS for a global perspective project that many sites will use. To ensure alignment on the versions of the app being used across sites I am using tags in Git to record app commit versions.

When testing this week I am cloning the project from GitHub to a new server/gateway and I can see the tag value in the project folder structure: in ‘.git’. Happy days!

Trying to pull that string value, say v1.3.1, into a gateway tag to use for a visual is the next challenge.

I have tried some clunky gateway scripts that look for the latest value in the project folder structure, but it does not feel slick, feels like a workaround.

With more SCS ‘fluency’ in 8.3 is there an easier way to do this? Have I missed something?

Or would this be a suggestion? Maybe push the most recent value into the Views session props?

---

<div class="post-metadata">

**Author:** ![Craig\_Simpson](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Craig\_Simpson](https://forum.inductiveautomation.com/u/Craig_Simpson)\
**Post date:** [November 21, 2025, 1:07pm UTC](https://forum.inductiveautomation.com/t/pulling-git-version-semantic-tag-into-project/112353/2 "2025-11-21T13:07:06Z")

</div>

My own clunky way..

```python
`def onUpdate(actor, resources):
#Grabbing the git tag latest version to write into a gateway tag
#Thank you Co-Pilot!!!!
import subprocess
logger = system.util.getLogger('clockInApp')

#Repo & Git
project_path = r"C:\Program Files\Inductive Automation\Ignition\data\projects\ClockIn"
git_exe = r"C:\Program Files\Git\bin\git.exe"
#Git wants forward slashes in safe.directory
safe_path = project_path.replace("\\", "/")

def run_git(args):
    cmd = [git_exe, "-c", "safe.directory=%s" % safe_path] + args
    return subprocess.check_output(cmd, cwd=project_path).strip()

try:
    #Try describe first
    try:
        latest_tag = run_git(["describe", "--tags", "--abbrev=0"])
    except subprocess.CalledProcessError:
        # Fallback to newest tag by date
        tags = run_git(["tag", "--sort=-creatordate"]).splitlines()
        latest_tag = tags[0] if tags else "<no tag>"
            
    logger.info("Resolved latest tag: %s" % latest_tag)
    system.tag.writeBlocking("[default]ClockIn/versionNum", [latest_tag])

except Exception as e:
    logger.error("Git command failed: %s" % e)`

```

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [November 21, 2025, 2:53pm UTC](https://forum.inductiveautomation.com/t/pulling-git-version-semantic-tag-into-project/112353/3 "2025-11-21T14:53:39Z")

</div>

Calling out to a `git describe` sub-process on project update and storing the result in a tag is the method we use in our system. I did use the `--always` and `--broken` options to git describe so that we always get _something_ even if the system somehow lands on an unexpected or corrupted spot in git.

---

<div class="post-metadata">

**Author:** ![Craig\_Simpson](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Craig\_Simpson](https://forum.inductiveautomation.com/u/Craig_Simpson)\
**Post date:** [November 24, 2025, 1:11pm UTC](https://forum.inductiveautomation.com/t/pulling-git-version-semantic-tag-into-project/112353/4 "2025-11-24T13:11:15Z")

</div>

Thank you Justin, glad to hear someone is doing it in a similar way.

I did add your suggestions, but did not like seeing -dirty in my app front screen 🙂

Have added..

```python
latest_tag = run_git(["describe", "--tags", "--abbrev=0", "--always", "--broken", "--dirty="])

```
