Skip to content

Instantly share code, notes, and snippets.

@1oglop1
Created November 7, 2025 17:25
Show Gist options
  • Save 1oglop1/021aefc33fba7d6dcca91b0dfb87d755 to your computer and use it in GitHub Desktop.
Save 1oglop1/021aefc33fba7d6dcca91b0dfb87d755 to your computer and use it in GitHub Desktop.
Git++
function gitpp() {
# makes a commit with a number increased from the last commit message
# eg: hello -> hello 2 -> hello 3
git commit -am "$(git --no-pager show -s --format=%s | awk 'BEGIN{FS=OFS=" "} {if($NF ~ /^[0-9]+$/) $NF++; else $NF=$NF" 2"}1')" && git push
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment