This recipe provides a simple way to get the current Git commit hash in TeamCity build configurations. In the default configuration, the commit hash is available as environment variable %env.GIT_COMMIT_SHORT_HASH%.
We are TeamCity Certified and YouTrack Certified developers, specializing in custom solutions for JetBrains products.
👉🏼 Visit our website to learn more about our services.
You need to have TeamCity 2025.03 or later installed to use this recipe. If you are using an older version than 2025.07, you need to upload the git-commit-hash.yml, which contains the complete recipe. If you are using TeamCity 2025.07 or later, you can use the jjideenschmiede/git-commit-hash recipe directly from the JetBrains Marketplace.
If you want to build this recipe, you can use the following command:
gradle recipeIf you have any questions or need support, feel free to reach out to us via e-mail or visit our website.