3

I would like to generate a simple, increasing version integer, based on when a commit has changed a certain folder. And, I want this version number to be valid across branches.

To illustrate, suppose the folder is named FOO, and it is on BRANCH1 and BRANCH2. Let's say version V is currently equal to 10.

1) make a commit that modifies FOO on BRANCH1: I would like V = 11 2) now make a commit that modifies FOO on BRANCH2: I would like V = 12

Any help would be greatly appreciated! Jacko

Jacko
  • 12,665
  • 18
  • 75
  • 126

1 Answers1

0

Branches are mere pointers on a graph.

git describe remains the only "label" valid across repos.
This question has an example where git describe is used to generate a "Vxxx".

You also have git name-rev if you want a "label" relative to a branch (but not valid across repos).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250