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:
Had the same problem with different casing.
Did a checkout to development (or master) then changed the name (the wrong name) to something else like test.
then change the name back to the right name
then checkout to the right-name branch
then it worked to push to the remote branch
I was having this issue as well, and it was driving me crazy. I had something like feature/name
but git branch -a
showed me FEATURE/name
. Renaming the branch, deleting and recreating it, nothing worked. What finally fixed it:
Go into .git/refs/heads
You'll see a FEATURE
folder. Rename it to feature
.
for me I was naming branch as
Rel4.6/bug/Some-short-description
all I had to do is when using
git push origin Relx.x/bug/Some-short-description
to write
git push origin relx.x/bug/Some-short-description
as I used to create branches using small letter r in rel.
so, what caused this issue?
when I listed .git/refs/heads
content I found
drwxr-xr-x 4 eslam_khoga staff 128B Sep 22 20:22 relx.x
but no Relx.x
!
and inside it bug
and inside bug
my branch's name.
So, git try to create a dir with same name but different case letters
but system is not case sensitive.
That's what caused this issue!
If you are in local branch, could rename the branch "Feature/Name" to "feature/Name"
git -m feature/Name
if you have problems to make a git push
make a checkout in other branch (ex develop) and return to renamed branch
git checkout feature/Name
and try again your git push
I had the same problem but was resolved. I realized branch name is case sensitive. The main branch in GitHub is 'master', while in my gitbash command it's 'Master'. I renamed Master in local repository to master and it worked!
I solved this in Windows 10 by using cmd instead of GitBash.
It has to do with character case and how git and command lines handles them.