2022-11-16 16:40:46 +02:00

19 lines
359 B
Bash
Executable File

#!/usr/bin/env bash
# this script is meant to be sourced
function git:branch-name {
git rev-parse --abbrev-ref HEAD
}
function git:is-on-main {
if [[ "$(git:branch-name)" == "main" ]]
then return 0
else return 1
fi
}
function git:branch-exists-remotely {
git ls-remote --exit-code --heads origin "$(git:branch-name)" > /dev/null
}