| 123456789101112131415161718192021222324252627 | #!/bin/bash# .git/hooks/pre-pushecho "Verifying if the target branch matches the version in gradle.properties"# Get the current branch namebranch_name=$(git symbolic-ref --short HEAD)# Verify if branch name ends with '.x'if [[ ! "$branch_name" =~ \.x$ ]]; then  echo "Branch name '$branch_name' does not end with '.x', skipping verification."  exit 0fi# Extract version from gradle.propertiesversion=$(cat gradle.properties | grep 'version=' | awk -F'=' '{print $2}')# Extract the version prefix from the versionversion_prefix=$(echo $version | cut -d'-' -f1 | sed 's/\.[0-9]*$//')# Check if branch starts with the version prefixif [[ "$branch_name" != "$version_prefix"* ]]; then  echo "Branch name '$branch_name' does not match the version prefix '$version_prefix' in gradle.properties. Make sure you are pushing to the right branch."  exit 1fiexit 0
 |