Prefer "main" to "master"
See
1e7fa50da0
.
> This commit introduces `git-master-to-main-wrapper`, which seamlessly
prefers `main` to `master` but works fine with repos that do use
a `master` branch.
This commit is contained in:
parent
2e8c717036
commit
0f797c6ffe
4 changed files with 40 additions and 4 deletions
tag-zsh/zsh/configs
|
@ -1,7 +1,14 @@
|
|||
# No arguments: `git status`
|
||||
# With arguments: acts like `git`
|
||||
g() {
|
||||
if [[ $# > 0 ]]; then
|
||||
if [[ $1 == init ]];
|
||||
then
|
||||
# Prefer "main" to "master"
|
||||
git "$@"
|
||||
git checkout -b main
|
||||
git branch -d master
|
||||
elif [[ $# > 0 ]];
|
||||
then
|
||||
git $@
|
||||
else
|
||||
git status --short --branch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue