#!/bin/bash usage() { cat << EOF >&2 Usage: `basename $0` [branch_name] Creates the specified branch and checks it out. Run this in the top directory of a cloned repository! Assumes the following have been done: git clone --recurse-submodules https://github.com/[git_user]/[doc_repo].git git remote rename origin [git_user] git remote add ivoa-std git://github.com/ivoa-std/[doc_repo].git EOF } git_user="tomdonaldson" # customize this or make it an argument branch_name=$1 # The name of the document repository (e,g, VOTable) # Require exactly one argument if [ $# -ne 1 ]; then echo "Incorrect # of arguments" usage exit 1 fi # Ensure our local clone has everything it needs from the forked repo. git fetch ivoa-std # Create the new branch based on master at git://github.com/ivoa-std/[doc_repo].git git branch ${branch_name} ivoa-std/master git checkout ${branch_name} # Connect the branch to your github repo. pFuture Pushes will get pushed to the # your upstream branch by default. git push --set-upstream ${git_user} ${branch_name}