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:
Maybe your forgot to run git fetch? it's required to fetch data from the remote repo! Try running git fetch remote/branch
You might have created similar branch but different case-sensitive-wise, then you have to run:
git branch -D <name-of-different-case-branch>
and then try to push again.
It's case-sensitive, just make sure created branch and push to branch both are in same capital.
Example:
git checkout -b "TASK-135-hello-world"
WRONG way of doing:
git push origin task-135-hello-world #FATAL: task-135-hello-world cannot be resolved to branch
CORRECT way of doing:
git push origin TASK-135-hello-world
I just had this issue as well and my normal branches start with pb-3.1-12345/namebranch
but I accidental capitalized the first 2 letters PB-3.1/12345/namebranch
. After renaming the branch to use lower case letters I could create the branch.
Git will let you checkout the current branch with a different casing, and it will fail to find a ref on the remote.
Just found out the hard way.
A similar thing happened to me. I created a branch called something like "Feat/name". I tried to pushed it using :
git push --set-upstream origin Feat/name
I got the same fatal error as you :
fatal: Feat/name cannot be resolved to branch
To solve it I created a new branch as I had very few files impacted. Then I listed my branches to delete the wrong one and it displayed with no cap :
I had used caps before but never on the first caracter. It looks like git doesn't like it...