Skip to content

Instantly share code, notes, and snippets.

@tonning
Last active December 12, 2017 17:45
Show Gist options
  • Save tonning/152927751a17acf2ce8dd82b091fbdf4 to your computer and use it in GitHub Desktop.
Save tonning/152927751a17acf2ce8dd82b091fbdf4 to your computer and use it in GitHub Desktop.
Git save and resume work in progress aliases
[alias]
save = "!f() { \
echo \"\\033[32mSaving Work in Progress...\"; \
git add . && git commit -m 'WIP'; \
}; f"
resume = "!f() { \
if [[ $(git log --format=%B -n 1 | grep WIP) == WIP ]]; then \
echo \"\\033[32mResuming Work in Progress...\"; \
git reset HEAD~; \
else \
echo \"\\033[31mNo Work in Progress to resume...\"; \
fi \
}; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment