diff --git a/gitlab-build.sh b/gitlab-build.sh
index 437173da7c1bb1ccee76d48fdb8cf549d83ad7c1..d8b7793c3097126f9991c5359f5b047d3dc316ed 100755
--- a/gitlab-build.sh
+++ b/gitlab-build.sh
@@ -122,13 +122,7 @@ elif [ "$CI_COMMIT_TAG" != "" ]; then
 	export GITLAB_HOST=$CI_SERVER_HOST
 	export PROJECT_REPO=docs.beagleboard.io
 	git fetch --all -v
-	git checkout main
-	echo "git branch output check"
-	git branch
-	echo "$(git branch -a --contains tags/$CI_COMMIT_TAG)"
 	export GIT_BRANCH=$(git branch -a --contains tags/$CI_COMMIT_TAG | grep origin | tr -d '* ' | sed 's/.*origin\///' | head -n 1)
-	echo "**** $GIT_BRANCH contains tags/$CI_COMMIT_TAG ****"
-	git checkout $GIT_BRANCH
 	export PROJECT_BRANCH=$GIT_BRANCH
 	if [ "$GIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]; then
 		export VER_DIR=latest