After having renaming the 'master' branch (using Sourcetree), I can't fetch anymore the changes done in the remote repository.
I get the error:
error: cannot open .git/FETCH_HEAD: Permission denied
When I open this file, I see that the referenced branch is still set toward branch 'master'
.
Taking a look at the remote repository, I saw that a branch with named 'master' still exists, in addition to the renamed branch where I merged my last changes. I think there have got a problem somewhere and the renaming was not replicated correctly in the remote repository.
I have tried to manually edit the FETCH_HEAD
(changing the full SHA and the pointed branch), but I still get this error. Of course, I can not rename again as before my main branch, since a branch named 'master' is always present.
Is there a way around this problem?