mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
19 lines
359 B
Bash
Executable File
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
|
|
}
|