Created
April 8, 2025 07:56
-
-
Save kvz/5ae34553c7f8fea3978c232fe81deec8 to your computer and use it in GitHub Desktop.
saveWIPAndSync
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
// Add this to your keybindings.json, you can find it by typing Keyboard from the command palette | |
... | |
{ | |
"key": "shift+cmd+enter", | |
"command": "workbench.action.tasks.runTask", | |
"args": "saveWIPAndSync" | |
} | |
... |
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
// Place this in your .vscode dir in the repo where you want to use this | |
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "saveWIPAndSync", | |
"type": "shell", | |
"command": "branch=$(git rev-parse --abbrev-ref HEAD); if [ \"$branch\" = \"main\" ]; then echo 'Error: Cannot commit WIP to main branch.'; exit 1; else git add . && git commit -m 'Save WIP state' && git push; fi", | |
"problemMatcher": [], | |
"presentation": { | |
"reveal": "never" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment