#!/bin/bash

# Get the name of the default branch
default_branch=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')

# Get the name of the current branch
current_branch=$(git symbolic-ref --short HEAD)

if [ "$current_branch" = "DevOps" ]; then
    if [ "$current_branch" != "$default_branch" ]; then
        echo "swiching to '$default_branch'..."
        git fetch origin "$default_branch"
        git checkout "$default_branch"
    else
        echo "'DEVOPS' branch is already on the default branch ('$default_branch')."
    fi
else
    echo "Current branch ('$current_branch') is not 'DEVOPS'."
fi
