dotfiles/bin/git-create-new-tracking-branch

16 lines
322 B
Bash
Executable file

#!/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}"