change-branches.sh 377 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. defaultPath=./src/hello-world
  3. defaultBranch=master
  4. src=plugins
  5. clonefile=change-branches.sh
  6. clonepath=${src}/${clonefile}
  7. instance=${1:-""}
  8. if [ -e ${clonepath} ] ; then
  9. sh ${clonepath} ${instance}
  10. else
  11. echo "Ignored input: ${instance}"
  12. echo "Default checkout uses branch: ${defaultBranch}"
  13. cd ${defaultPath}
  14. git checkout ${defaultBranch}
  15. fi