Skip to content

Instantly share code, notes, and snippets.

@brunomunizaf
Created January 16, 2021 05:46
Show Gist options
  • Save brunomunizaf/192e59264c074fe986950b01622910c1 to your computer and use it in GitHub Desktop.
Save brunomunizaf/192e59264c074fe986950b01622910c1 to your computer and use it in GitHub Desktop.
git_release() {
# 1
git=$(sh /etc/profile; which git)
number_of_commits=$("$git" rev-list HEAD --count)
# 2
latest_tag=$(git describe --abbrev=0)
commits_diff=$(git log --pretty="%h - %s (%an)" $latest_tag..HEAD)
git tag -a b$number_of_commits -m "$commits_diff"
# 3
git push origin development
git push origin --tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment