Skip to content

Instantly share code, notes, and snippets.

@vipickering
Last active September 5, 2017 13:56
Show Gist options
  • Save vipickering/f2e275cd7ceeb047eb66b9e52d5b0034 to your computer and use it in GitHub Desktop.
Save vipickering/f2e275cd7ceeb047eb66b9e52d5b0034 to your computer and use it in GitHub Desktop.
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
Copy link
Author

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
Copy link
Author

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