I'm fetching for remote branches and stuck in some sort of a loop.
I fetch once and get:
$ git fetch
* [new branch] minorRelease/something-> origin/minorRelease/something
And then I fetch again and get:
$ git fetch
* [new branch] minorRelease/Something-> origin/minorRelease/Something
Same branch but with a capital S
.
I tried to delete the file from the following folder .git/refs/remotes/origin/minorRelease
, but when fetching again, I get both and return to the loop above:
$ git fetch
* [new branch] minorRelease/Something-> origin/minorRelease/Something
* [new branch] minorRelease/something-> origin/minorRelease/something
Note: with Git 2.12 (Q1 2017) this will become easier to spot, as you can list branch with a case insensitive option.
See commit 3bb16a8 (04 Dec 2016) by Nguyễn Thái Ngọc Duy (
pclouds
).(Merged by Junio C Hamano --
gitster
-- in commit 73e494f, 19 Dec 2016)Note: The "
--ignore-case
" option of "git for-each-ref
" (and its friends) did not work correctly, which has been fixed in Git 2.19 (Q3 2018).See commit 639ab5e (02 Jul 2018) by Aleksandr Makarov (
deviance
).See commit e674eb2, commit ee0f3e2 (02 Jul 2018) by Jeff King (
peff
).(Merged by Junio C Hamano --
gitster
-- in commit 4301330, 24 Jul 2018)@torek
is right that it's caused by the difference ofLinux
andWindows
.Linux
is case-sensitive, whileWindows
is not. You can usels-remote
to show the branches in the server.And I think in your case, the output should include the two branches with only the case of
S
different.You can delete the remote branch if you find one of them is actually duplicated. And then do
fetch
again. It should be fine now.