Skip to content

Instantly share code, notes, and snippets.

@kmcallister
Created April 28, 2012 20:37
Show Gist options
  • Save kmcallister/2521834 to your computer and use it in GitHub Desktop.
Save kmcallister/2521834 to your computer and use it in GitHub Desktop.
update mosh repo
#!/bin/bash -e
git fetch keithw
was_master=
if out=$(git symbolic-ref HEAD); then
if [ "$out" = "refs/heads/master" ]; then
git checkout HEAD@{0}
was_master=yes
fi
fi
git push . keithw/master:master
git push origin master
if [ -n "$was_master" ]; then
git checkout master
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment