Last active
July 10, 2025 13:07
-
-
Save guilhermeprokisch/868c2b0f701628ab81d4760af67d9910 to your computer and use it in GitHub Desktop.
Conventional commit git alias
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
build = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"build(${2}): ${@:3}\"; else git commit -m \"build: ${@}\"; fi }; a" | |
chore = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"chore(${2}): ${@:3}\"; else git commit -m \"chore: ${@}\"; fi }; a" | |
ci = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"ci(${2}): ${@:3}\"; else git commit -m \"ci: ${@}\"; fi }; a" | |
docs = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"docs(${2}): ${@:3}\"; else git commit -m \"docs: ${@}\"; fi }; a" | |
feat = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"feat(${2}): ${@:3}\"; else git commit -m \"feat: ${@}\"; fi }; a" | |
fix = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"fix(${2}): ${@:3}\"; else git commit -m \"fix: ${@}\"; fi }; a" | |
perf = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"perf(${2}): ${@:3}\"; else git commit -m \"perf: ${@}\"; fi }; a" | |
refactor = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"refactor(${2}): ${@:3}\"; else git commit -m \"refactor: ${@}\"; fi }; a" | |
revert = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"revert(${2}): ${@:3}\"; else git commit -m \"revert: ${@}\"; fi }; a" | |
style = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"style(${2}): ${@:3}\"; else git commit -m \"style: ${@}\"; fi }; a" | |
test = "!a() { if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"test(${2}): ${@:3}\"; else git commit -m \"test: ${@}\"; fi }; a" | |
wip = "!a() { TIMESTAMP=$(date +%s); if [[ \"$1\" == \"-s\" || \"$1\" == \"--scope\" ]]; then git commit -m \"wip(${2}): [${TIMESTAMP}] ${@:3}\"; else git commit -m \"wip: ${TIMESTAMP}\"; fi }; a" | |
release = "!f() { git commit -m \"release: $1\" && git tag \"$1\"; }; f" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment