Skip to content

Instantly share code, notes, and snippets.

@vipickering vipickering/terminal
Last active Sep 5, 2017

Embed
What would you like to do?
Git Panic
alias panic="branchName='$(date +%Y-%m-%d-%H-%M)' && git checkout -b panic-'${branchName}' && git add -A && git commit -m 'panic' && git push --set-upstream origin panic-'${branchName}'"
@vipickering

This comment has been minimized.

Copy link
Owner Author

commented Aug 30, 2017

This creates a git branch with a time and date stamp, prefixed with "panic" for easy identification. You can return to later and ensure the code isn't lost.

@vipickering

This comment has been minimized.

Copy link
Owner Author

commented Sep 5, 2017

Updated to a var to ensure times match. Removed seconds to double ensure we don't get odd clashes.
As per Feedback here: https://twitter.com/vonorm_/status/905055729639464960

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.