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
| # WHAT: Create a commit with the branch name as a prefix | |
| # WHY: Save yourself some time when creating a commit and reduce errors by automating the addition of the branch name | |
| # HOW: i.e. "gc add a new something" on branch ABC-123 will create a commit "ABC-123: add a new something" | |
| # Remove existing alias if any | |
| unalias gc 2>/dev/null | |
| gc() { | |
| branch=$(git rev-parse --abbrev-ref HEAD) | |
| git commit -m "$branch: $*" | |
| } |