1

I keep running into this same issue when I try and push up a new remote branch to github and Im not sure how to handle it. This is whats happening:

  1. I create a branch for example git checkout -b feature/5110
  2. Make my changes to that branch
  3. Commit those changes git add . git commit -m "made changes"
  4. Then I checkout to my develop branch git checkout develop (if for one reason or another I am unable to push at that time)
  5. When I return to that branch git checkout feature/5110 I try and push git push
  6. I get the message :

To push the current branch and set the remote as upstream, use

`git push --set-upstream origin feature/5110` 
  1. So I run git push --set-upstream origin feature/5110
  2. Then I get the error :

fatal: feature/5110 cannot be resolved to branch.

The only way ive found to work around this is to delete my branch and start over which is not effective now that I'm making larger changes. Can anyone tell me whats happening and how to resolve?

4
  • 1
    git checkout -m to create a branch? No. -b is the option to create a branch upon checkout. -m is useful in the context of conflict resolution, this is a confusion. Commented Nov 11, 2020 at 19:41
  • 1
    yes that was a typo i will correct Commented Nov 11, 2020 at 19:44
  • Does this answer your question? Can't push to remote branch, cannot be resolved to branch Commented Nov 11, 2020 at 20:35
  • So, is this a name-casing issue? (As in, does the link @flaxel suggested apply?) If so I can close this as a duplicate. Commented Nov 12, 2020 at 7:13

1 Answer 1

1

The issue here was that vscode was not properly switching branches. I did git branch and found no green highlight indicating which branch I was in. Ended up having to close and relaunch vscode then git checkout theBranch then I did git branch to verify I was in the right branch and I was able to push up after this.

Sign up to request clarification or add additional context in comments.

1 Comment

it just says "already on" that branch

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.