her.esy.fun/src/Scratch/en/blog/06_How_I_use_git/code/git-create-new-branch

13 lines
237 B
Bash

#!/usr/bin/env zsh
if (($#<1)); then
print -- "usage: $0:t branch_name" >&2
exit 1
fi
branch=$1
git br ${branch}
git co ${branch}
git config branch.${branch}.remote origin
git config branch.${branch}.merge refs/heads/${branch}