Skip to content

Instantly share code, notes, and snippets.

@gustavocoleta
Last active July 13, 2021 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gustavocoleta/fbe4013b694126b7886d19d0242ac9b4 to your computer and use it in GitHub Desktop.
Save gustavocoleta/fbe4013b694126b7886d19d0242ac9b4 to your computer and use it in GitHub Desktop.
Obter a quantidade de commits após a ultima tag criada
  1. Obter a ultima tag criada
$ git describe --tags --abbrev=0 $(git rev-list origin/main --tags --max-count=1)
  1. Obter o sha através do nome da tag
$ git log origin/main v1.2.9 -1 --pretty=%H
  1. Obter a quantidade de commits após um sha
$ git rev-list origin/main 6769d6e7d29fe626b4640c20f715344b236239be..HEAD --count
  1. Todos os scripts anteriores agrupados
$ git rev-list origin/main $(git log origin/main $(git describe --tags --abbrev=0 $(git rev-list origin/main --tags --max-count=1)) -1 --pretty=%H)..HEAD --count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment