git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git an case-insensitive Mac OS X filesystem

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 11, 2012, 15:40 UTC
Message-ID
<7vhar4k1o5.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAPLaKK71O3RzavOqY2uVC1tUsbs+W6WxJRWuLBDFUvTwojAN-g@mail.gmail.com>
Roger Pau Monné <roger.pau@entel.upc.edu> writes:
Show 18 quoted lines
> Hello,
>
> I'm using git for all my projects, and I usually work under Mac OS X
> with the default filesystem (that's case-insensitive, but
> case-preserving). I'm currently working on a project that has several
> branches, and two of them are called origin/DHCPCD and origin/dhcpcd
> respectively, that's unfortunate, but I cannot do anything about it.
> This completely breaks the git repository, because
> .git/refs/remotes/origin/DHCPD and .git/refs/remotes/origin/dhcpd are
> actually the same file, so when I try to update my repository
> performing a git pull I get the following error:
>
> error: Ref refs/remotes/origin/dhcpcd is at
> 6b371783de2def2d6e3ec2680ba731f7086067ee but expected
> 79f701ce599a27043eed8343f76406014963278a
>
> So I was wondering if anyone has stumbled upon this issue, and what's
> the best approach to fix it.

If "several" is manageably small, you can configure your refspecs to rename them, e.g.

	[remote "origin"]
		url = ...
                fetch = +refs/heads/master:refs/remotes/origin/master
                fetch = +refs/heads/dhcpcd:refs/remotes/origin/dhcpcd
                fetch = +refs/heads/DHCPCD:refs/remotes/origin/dhcpcd-u
which tells
	$ git fetch origin

to use your remote tracking branch origin/dhcpcd-u to copy from their DHCPCD. Then you can work on it the usual way.

	$ git checkout -b dhcpcd-u origin/dhcpcd-u
        $ work work work
For pushing, you can rename it back in a similar way.
        $ git push origin dhcpcd-u:DHCPCD
which is a short-hand for
        $ git push origin refs/heads/dhcpcd-u:refs/heads/DHCPCD
Previous: Matthieu MoyNext: Roger Pau Monné
Message 6 of 10 in “Git an case-insensitive Mac OS X filesystem”
  1. Roger Pau MonnéSep 11, 2012
  2. Erik Faye-LundSep 11, 2012
  3. Matthieu MoySep 11, 2012
  4. Erik Faye-LundSep 11, 2012
  5. Matthieu MoySep 11, 2012
  6. Junio C HamanoSep 11, 2012
  7. Roger Pau MonnéSep 11, 2012
  8. Tomas CarneckySep 11, 2012
  9. Roger Pau MonnéSep 11, 2012
  10. Junio C HamanoSep 11, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.