Function to replace `master` with the default branch
GDK repo already changed from master
to main
. Other repos will follow, most likely.
This MR introduces a function to check what's the default branch and use it for all Git operations.
# Get the default branch name:
DEF_BRANCH=$(git remote show origin | grep "HEAD branch" | cut -d ":" -f 2 | tr -d ' ')
# Use it for `git checkout master`, for example:
git checkout $DEF_BRANCH