Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git remote two branches same name different case

Tags:

git

bash

origin/joetest
origin/JoeTest

I have a problem I have two remote branches in git which are the same name with different case.

I can't work out what todo in visual studio online I can see the differences but it can't merge them because of conflicts.

The git tools in visual studio and git bash can't tell the difference between the two cases and the people working on them the syncing is now off with some commits on one and some on the other.

any thoughts on what the heck we can do?

thanks

like image 529
Kisbys Avatar asked Aug 04 '15 16:08

Kisbys


1 Answers

Clone the repository on an operating system with a case-sensitive file system, e.g. Linux, then rename one of the branches, push it, and delete the old branch:

git clone <url> repo
cd repo
git checkout -b joetest2 origin/JoeTest
git push origin joetest2:joetest2
git push origin :JoeTest

As for why Git is having issues with branch names with different case, see this related question.

like image 62
poke Avatar answered Sep 22 '22 19:09

poke