#!/bin/sh . $HOME/.shenv set -e cd $HOME/src/dotfiles hostname="$(hostname)" # use '-s' ? if git rev-parse refs/heads/$hostname >/dev/null 2>&1; then git checkout $hostname git rebase master if ! git push origin master +$hostname; then git dotfiles-dummy-master-commit git push origin master +$hostname fi else if ! git push origin master; then git dotfiles-dummy-master-commit git push origin master fi fi