Practicalweb Ltd

Technical information on this site may be out of date : no updates since 2015

mini scripts to obtain git id/branch/tag

February 5 2013 : posted under git
$new_branch=$1 # passed as param

current_branch="$(git symbolic-ref HEAD 2>/dev/null)"
current_branch=${current_branch##refs/heads/}

current_id=$(git rev-parse --short origin/$current_branch)

new_id=$(git rev-parse --short origin/$new_branch)

last_tag=$(git describe --abbrev=0 --tags)