We have a script that actually does git fetch; git checkout origin/ to deploy a certain feature. The reason why we do this is that we wan\'t to avoid
git fetch; git checkout origin/
The best solution for us, pointed by @SébastienDawans, was git show -s --pretty=%d HEAD. The output is like remotes/origin/, so maybe a cleaning is required, but for our needs it's just fine.
git show -s --pretty=%d HEAD
remotes/origin/