0

I thought I had lost a previous branch I created under the name distanceFieldV2 (notice the capital V) and so I created another branch with the name distanceFieldv2 (now notice the lower v) Both were pushed to the remote repository and today I realized I should merge them into one. I tried to pull them to my local working directory using the following commands

git branch --track distanceFieldV2 origin/distanceFieldV2
git branch --track distanceFieldv2 origin/distanceFieldv2

which resulted in the error

fatal: A branch named 'distanceFieldApproximatedv2' already exists.

I'm sure there was no other branch with the name in the error before executing the second command.

How is this possible to have those two branches on the remote repository but when trying to track those in my local copy I'm not able to have them because apparently they have the same name?

BRabbit27
  • 6,333
  • 17
  • 90
  • 161
  • I am wondering... Is the remote filesystem case-sensitive? (i.e, windows server) – MayeulC Nov 09 '16 at 16:13
  • I have no clue, but there might be a big chance it is, hence the error Im getting? – BRabbit27 Nov 09 '16 at 16:23
  • See http://stackoverflow.com/a/38494084/1256452 (slightly different question, but maybe close enough to close this one as a duplicate). The summary is that Git tries to act as though `branch` and `BRANCH` are *different* names, but sometimes defeats itself by using OS-level files in which they are the *same* name. – torek Nov 09 '16 at 17:13
  • @torek I agree, I think it explains what the underlying problem is. I decided to name by second branch with a different name and then merge both. I'll pay attention next time to not have branches with same name. – BRabbit27 Nov 09 '16 at 18:19

0 Answers0