# Bug: Git checkout case Insensitive branch name compare

2 messages from 2017-07-10 to 2017-07-11. Participants: kinchit raja, Jeff King.
Thread: https://gitlist.dev/t/46349

## kinchit raja, 2017-07-10 20:15

Subject: Bug: Git checkout case Insensitive branch name compare
Message-ID: <CAKvSMhhO7RwiZfpcLR3cK2TXF-v9MrO1N33t8BqX=8f9z=Gd0w@mail.gmail.com>
URL: https://gitlist.dev/e/CAKvSMhhO7RwiZfpcLR3cK2TXF-v9MrO1N33t8BqX%3D8f9z%3DGd0w%40mail.gmail.com

```
Bugs Details:

Git checkout case Insensitive branch name compare

Steps to Reproduce:

 I have a remote branch which is as shown below.
Example: feature_12345_write.netCodeForSomeFeature

 I used the git command on git bash and typed
"feature_12345_write.NetCodeForSomeFeature" thinking I am mapping
"feature_12345_write.netCodeForSomeFeature" locally.

So after I got the branch locally, I tried git pull and I see the following
"Your configuration specifies to merge with the ref
'refs/heads/feature_12345_write.NetCodeForSomeFeature' from the
remote, but no such ref was fetched.

 Although when I did "git log", it shows proper history for
"feature_12345_write.netCodeForSomeFeature" branch.

However when I use the command "git pull --rebase origin branch" it
says "fatal: Couldn't find remote ref
feature_12345_write.NetCodeForSomeFeature"
Because the remote branch has 'n' instead of 'N' in '.net' for branch name.

This is because I used "git checkout branch" instead of "git checkout
branch origin/remote branch name" since the local branch name I wanted
was the same as the remote branch name.

I don't see this in other branches.

I think the command is not considering case sensitivity of characters
in the branch name.

Thanks.

-- 
Best Regards,
Kinchit Raja

```

## Jeff King, 2017-07-11 07:38

Subject: Re: Bug: Git checkout case Insensitive branch name compare
Message-ID: <20170711073836.3nclljuzqgwdg6t5@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20170711073836.3nclljuzqgwdg6t5%40sigill.intra.peff.net
In-Reply-To: <CAKvSMhhO7RwiZfpcLR3cK2TXF-v9MrO1N33t8BqX=8f9z=Gd0w@mail.gmail.com>

```
On Mon, Jul 10, 2017 at 01:15:40PM -0700, kinchit raja wrote:

> Bugs Details:
> 
> Git checkout case Insensitive branch name compare

Right, this is known. Branch names (and all ref names) are case
sensitive in Git. Storage on a case-insensitive filesystem may lead to
confusion if you mix the cases. Sometimes it will work, and sometimes it
will create quite confusing results. One suggested path forward is to
encode characters in the filesystem. See:

  http://public-inbox.org/git/20170705083611.jgxbp4sqogicfwdb@sigill.intra.peff.net/

and further down-thread:

  http://public-inbox.org/git/xmqqo9sxdwjp.fsf@gitster.mtv.corp.google.com/

for some recent discussion.

-Peff

```
