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:
origin: bitbucket
github: github
Then I removed both and pointed origin to github:
git remote remove origin
git remote remove github
git remote add origin https://github....
Test push of develop branch:
git push origin develop
Everything up to date, ok, good.
Create a new branch for some work as per usual:
git checkout -b Feature/Name
Update a file or two. Attempt to push to remote:
git push origin Feature/Name
This results in the error:
fatal: Feature/Name cannot be resolved to branch
Search online for this issue, find some stuff about ensuring HEAD is correct, others about making sure I've got my branch name case correct (though, at this point the branch doesn't exist on the remote yet). Unable to resolve.
Ran this command:
git push --all -u
This got my Feature/Name
branch to github, but still see same behavior as prior:
git push origin develop
git push origin Feature/Name
The first works while the second throws the same error. Why?
Feature/Name
? Are you sureFeature/Name
exists and that's the checked out branch? Check withgit branch
. – Diamagnetgit branch
to verifyFeature/Name
exists locally? Don't trust a GUI or IDE. Also, did you get the case right? – Diamagnetgit push origin Feature/Name:Feature/Name
? – Esquiregit push --all -u
I have the new branch in github, but still couldn't push from local, right? Here's what happened with that... the actual branch name isSQLMigration/ReportFixes
and what is in github isSqlMigration/ReportFixes
. So, now I cangit push origin SqlMigration/ReportFixes
- whytf does github change casing for me? Agh. – Simulacrumgit branch
is how I check, I rarely use GUIs for git. @Esquire - tried that too, got an error, then was going to grab a screenshot and realized the oh-so-helpful auto-case-change in the github branch per my previous comment. – Simulacrumgit push origin Feature/Name --
. Is it possible that Feature/Name can be resolved as a file in your repo? – Esquire