Short Git-REV: REV=$(git rev-parse HEAD) echo ${REV::7} or the correct way ;-) : git rev-parse --short HEAD