Skip to content

Instantly share code, notes, and snippets.

@adelegard
Last active August 29, 2015 14:00
Show Gist options
  • Save adelegard/11192769 to your computer and use it in GitHub Desktop.
Save adelegard/11192769 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script will move the last commit of your personal (computer name) branch back into master as uncommitted changes,
# then delete that branch
# This is intended to be used at the very start of the workday to continue working where you left off
git checkout $(uname -n) --quiet &&
git reset HEAD~1 --quiet &&
git stash >/dev/null &&
git checkout master --quiet &&
git stash pop >/dev/null &&
git branch -D $(uname -n) --quiet &&
git push origin :$(uname -n) --quiet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment