If .git/HEAD contains a hash, then you're in detached HEAD state, not
on the tip of a branch. So that is correct.
If you're on a branch, it should look like this: "ref: refs/heads/development".
I also had that problem with the git plugin and detached HEAD, thus i
execute in every job a Maven pre build step (as batch command):
git checkout development || git checkout -b development
git reset --hard origin/development
to get the branch and not detached HEAD.
Manuel
From: henrik <henrik....@gmail.com>
To: Jenkins Users <jenkins...@googlegroups.com>
Sent: Thursday, May 19, 2011 1:18 AM
Subject: Re: git branch name in shell script