#!/bin/sh

# Needs https://github.com/ingydotnet/git-subrepo installed

# get off master in libpebble3 (can't subtree to the branch we have checked out...)
pushd ../libpebble3
git checkout -b temp-push-subtree
popd

# add local libpebble3 repo as a remote
git remote add libpebble3-temp-local ../libpebble3/.git

# push public subtree to libpebble3
git subrepo push public

# remove the remote so we don't accidentally use it
git remote remove libpebble3-temp-local

# back to master in libpebble3
pushd ../libpebble3
git checkout master
git branch -d temp-push-subtree
popd

echo "\nCheck what just got committed to libpebble3, then push to the public remote when you're happy with that"
