# Automatic Versioning with Git and Gradle

DevFeed: [Automatic Versioning with Git and Gradle](<https://devfeed.tech/articles/automatic-versioning-with-git-and-gradle-30557.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2013/07/automatic-versioning-with-git-and-gradle/>)

Published: 2013-07-30T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Git](<https://devfeed.tech/topics/git.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [version-control](<https://devfeed.tech/topics/version-control.md>), [releases](<https://devfeed.tech/topics/releases.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [git](<https://devfeed.tech/tags/git.md>), [git-tags](<https://devfeed.tech/tags/git-tags.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [version-control](<https://devfeed.tech/tags/version-control.md>), [versioning](<https://devfeed.tech/tags/versioning.md>)

## AI overview

This tutorial explains how to use Git tags and a Gradle build script to derive Android marketing and build version numbers. Intermediate builds can include the latest release version, the number of commits since that release, and the commit SHA1 hash.

## Source excerpt

One of the challenges of programming projects is versioning. I've always tried to find a simple way to bump version and build number in a meaningful way that uniquely identifies a build. Back in the Subversion days this was easy, since Subversion is a centralized version control system that assigns a unique, incrementing revision number to each commit. Free build numbers! Then all you have to do is assign a marketing version number (something like 1.0) for each release.