Skip to content

Instantly share code, notes, and snippets.

@Voles
Last active August 20, 2020 10:10
Show Gist options
  • Save Voles/67915110ee4fa49ca61482fd4900203f to your computer and use it in GitHub Desktop.
Save Voles/67915110ee4fa49ca61482fd4900203f to your computer and use it in GitHub Desktop.
Bump patch file and push to origin
#!/usr/bin/env bash
bp () {
git fetch
latestTag=$(git tag | tail -n1)
versionParts=($(echo "$latestTag" | tr '.' '\n'))
newTag="${versionParts[1]}.${versionParts[2]}.$(($versionParts[3] + 1))"
echo "new patch version is: $newTag"
git tag $newTag
git push origin $newTag
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment