summaryrefslogtreecommitdiff
path: root/bin/git-dotfiles-rebase
blob: ed2e984e6ce5da4c0f84d1a8c448d3a1559a2d55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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