git: Add create-new-tracking-branch command
This commit is contained in:
parent
a73ce33f04
commit
fc8cdb3ee4
15
bin/git-create-new-tracking-branch
Executable file
15
bin/git-create-new-tracking-branch
Executable 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}"
|
Loading…
Reference in a new issue