From cded12e6c8e6a5b74ff08ea231e38ddd2c7d01d3 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Thu, 20 Aug 2020 10:31:40 -0400 Subject: [PATCH] Add script to update the wrap subtree --- update_wrap.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 update_wrap.sh diff --git a/update_wrap.sh b/update_wrap.sh new file mode 100755 index 0000000000..61f55e32ed --- /dev/null +++ b/update_wrap.sh @@ -0,0 +1,13 @@ +#!/bin/bash +REF=${1-master} # branch or tag; defaults to 'master' if parameter 1 not present +REMOTE=wrap # just a name to identify the remote +REPO=git@github.com:borglab/wrap.git # replace this with your repository URL +FOLDER=wrap # where to mount the subtree + +git remote add $REMOTE --no-tags $REPO +if [[ -d $FOLDER ]]; then # update the existing subtree + git subtree pull $REMOTE $REF --prefix=$FOLDER --squash -m "Merging '$REF' into '$FOLDER'" +else # add the subtree + git subtree add $REMOTE $REF --prefix=$FOLDER --squash -m "Merging '$REF' into '$FOLDER'" +fi +git remote remove $REMOTE \ No newline at end of file