Skip to content

Instantly share code, notes, and snippets.

@WolffDev
Created September 3, 2026 17:40
Show Gist options
  • Select an option

  • Save WolffDev/c458a0a89d9549cd16be190f221c0e96 to your computer and use it in GitHub Desktop.

Select an option

Save WolffDev/c458a0a89d9549cd16be190f221c0e96 to your computer and use it in GitHub Desktop.
# 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