My problem is related to Fatal Git error when switching branch.
I try to fetch a remote branch with the command
git checkout -b local-name origin/rem
After having tried most of what I could read in this thread without success, I stumbled across this one: Remote branch not showing up in "git branch -r"
It turned out that my .git/config file was incorrect. After doing a simple fix all branches showed up.
Going from
[remote "origin"]
url = http://stash.server.com/scm/EX/project.git
fetch = +refs/heads/master:refs/remotes/origin/master
to
[remote "origin"]
url = http://stash.server.com/scm/EX/project.git
fetch = +refs/heads/*:refs/remotes/origin/*
Did the trick