I migrated my repos from Bitbucket or Github. I don\'t think this matters but it\'s the only thing different... For a little while I had two remotes set up:
For my case, I used to have branch folder (or whatever it is called) with capital letters, then I create a new one with difference casing (lowercase) but git actually create the branch with capital.
I have created a branch like feature-ABC/branch1
before and pushed it. Then I create a branch feature-abc/branch2
(notice the lower-case ABC), and try to push it to remote using git push --set-upstream origin feature-abc/branch2
and get the 'cannot be resolved to branch' error. So I git branch
and see that it actually created feature-ABC/branch2
instead of feature-abc/branch1
for me. I checkout again with git checkout feature-ABC/feature2
and push it using the uppercase (feature-ABC/feature2
) to solve it.