Created
September 3, 2026 17:40
-
-
Save WolffDev/c458a0a89d9549cd16be190f221c0e96 to your computer and use it in GitHub Desktop.
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
| # Usage in terminal: | |
| # wip "your commit message" | |
| # This function creates a WIP commit with the provided message and pushes it to the remote repository. | |
| # It also handles errors gracefully and provides feedback to the user. | |
| # Make sure to replace "your commit message" with the actual message you want to use - with the quotes. | |
| wip() { | |
| git add . || { | |
| echo "Error: git add failed" >&2 | |
| return 1 | |
| } | |
| local message="${1:-wip}" | |
| git commit -m "$message" || { | |
| echo "Error: git commit failed" >&2 | |
| return 1 | |
| } | |
| git push || { | |
| echo "Error: git push failed" >&2 | |
| return 1 | |
| } | |
| echo "WIP commit and push successful" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment