Skip to content

Instantly share code, notes, and snippets.

@adelegard
Last active August 29, 2015 14:00
Show Gist options
  • Save adelegard/11190610 to your computer and use it in GitHub Desktop.
Save adelegard/11190610 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script will move any uncommitted changes in your current git repo directory to a personal
# branch equal to your computer name
# I wrote this with the intention of running this at the end of the day on all git branches that still have uncommitted code
# ... just in case I crash my bicycle on my way home and destroy my computer
git stash >/dev/null &&
git checkout -b $(uname -n) --quiet &&
git stash pop >/dev/null &&
git add . &&
git commit -m "your uncommitted changes committed!" --quiet &&
git push --quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment