Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/dev/preview/workflow/lib/git.sh
2500 views
1
#!/usr/bin/env bash
2
3
# this script is meant to be sourced
4
5
function git:branch-name {
6
git rev-parse --abbrev-ref HEAD
7
}
8
9
function git:is-on-main {
10
if [[ "$(git:branch-name)" == "main" ]]
11
then return 0
12
else return 1
13
fi
14
}
15
16
function git:branch-exists-remotely {
17
git ls-remote --exit-code --heads origin "$(git:branch-name)" > /dev/null
18
}
19
20