Oliver Davies
0f797c6ffe
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.
10 lines
221 B
Bash
Executable file
10 lines
221 B
Bash
Executable file
#!/bin/zsh
|
|
|
|
# Check if we should use the `main` or `master` branch for this repo.
|
|
# Prefer `main` to `master`.
|
|
|
|
if git show-ref --quiet origin/main || git rev-parse main &>/dev/null; then
|
|
echo main
|
|
else
|
|
echo master
|
|
fi |