We have a script that actually does git fetch; git checkout origin/<branch>
to deploy a certain feature. The reason why we do this is that we wan't to avoid local branches (it's a test server), so the script just fetch the latest changes and checkout into it, then reloads the server.
We also generate a log describing every deploy made, to bt sent by email to someone and archive. It's interesting that we send also the branch deployed, but the problem is when we do checkout origin/<branch>
, we're changing to a detached head. I read some answers with a similar question, but nothing so specific.
Is there a way to print what branch I am in this case (regardless user input, of course)?