git: Add create-new-tracking-branch command

This commit is contained in:
Oliver Davies 2021-05-21 22:56:18 +01:00
parent a73ce33f04
commit fc8cdb3ee4

View file

@ -0,0 +1,15 @@
#!/bin/sh
set -e
if [ "$#" -lt 1 ]; then
echo "Error: Not enough arguments."
exit l
fi
# Create a new branch including any additional arguments.
git checkout -b "$@"
# Push the branch to origin, bypassing any Git hooks.
new_branch_name=$1
git push --no-verify -u origin "${new_branch_name}:opd-${new_branch_name}"