Reputation: 508
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:
git checkout -b feature/5110
git add .
git commit -m "made changes"
git checkout develop
(if for one reason or another I am unable to push at that time)git checkout feature/5110
I try and push git push
To push the current branch and set the remote as upstream, use
`git push --set-upstream origin feature/5110`
git push --set-upstream origin feature/5110
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?
Upvotes: 1
Views: 7459
Reputation: 508
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.
Upvotes: 1