diff --git a/sh/update.sh b/sh/update.sh index 84158f7..9b5b952 100755 --- a/sh/update.sh +++ b/sh/update.sh @@ -1,6 +1,11 @@ #!/bin/bash # Updates the existing local and origin branches corresponding to the remix +# pass an argument if you want to pull a different branch name than the current branch you're on +# no argument needed to update against the branch name of the current branch -git checkout $1 -git pull $1 master -git push origin $1 \ No newline at end of file +# branch to use is the first argument, but if the first argument was not passed, use the current git branch +branchToUse="$1" && [[ -z "$1" ]] && branchToUse="$(git rev-parse --abbrev-ref HEAD)" + +git checkout $branchToUse +git pull $branchToUse master +git push origin $branchToUse \ No newline at end of file