her.esy.fun/src/Scratch/en/blog/05_git_create_remote_branch/code/git-create-new-branch.sh

13 lines
241 B
Bash
Raw Normal View History

2021-04-18 10:23:24 +00:00
#!/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}