update_wrap.sh 597 B

12345678910111213
  1. #!/bin/bash
  2. REF=${1-master} # branch or tag; defaults to 'master' if parameter 1 not present
  3. REMOTE=wrap # just a name to identify the remote
  4. REPO=git@github.com:borglab/wrap.git # replace this with your repository URL
  5. FOLDER=wrap # where to mount the subtree
  6. git remote add $REMOTE --no-tags $REPO
  7. if [[ -d $FOLDER ]]; then # update the existing subtree
  8. git subtree pull $REMOTE $REF --prefix=$FOLDER --squash -m "Merging '$REF' into '$FOLDER'"
  9. else # add the subtree
  10. git subtree add $REMOTE $REF --prefix=$FOLDER --squash -m "Merging '$REF' into '$FOLDER'"
  11. fi
  12. git remote remove $REMOTE