Question

Git-svn allowed for a duplicate filename, just with different case, to be added to our subversion repository.

On Windows this meant that subversion could not checkout the file, complaining of a duplicate.

Another developer deleted the incorrectly cased version from the repository. Now when trying to do a git-svn rebase I get a "could not detach HEAD" message and a complaint about the file name in question being untracked and needing to be overwritten. Deleting the file makes git-svn complain that the file needs to be updated.

Is the only solution to copy the repository to a machine with a case sensitive filesystem do the rebase then move it back?

I understand that git-svn isn't ready for real world work on Windows but I'd like to recover from this mess it has created.

Was it helpful?

Solution

Best current answer (I don't know if this existed back when this was originally posed):

git config core.ignorecase true

Then redo the rebase. It will proceed without error -- and will even properly handle the case change in the filename.

This isn't specific to git-svn. It can happen in a straight 'git rebase'.

I hope that helps the next person....

OTHER TIPS

I ran into a similar problem with Git (alone, not even with git-svn) getting very confused about changing the case of filenames when using a case-insensitive Mac filesystem. I didn't find a solution to fix the repository on the case-insensitive filesystem, but instead created a new case-sensitive volume in a .dmg file, mounted that, and used Git on that volume instead.

You may find that some of the Git "plumbing" commands might be helpful. For example, git checkout-index has a -f flag to force overwriting of existing files (also use -a with that command otherwise it might not do anything). The plumbing commands are generally more powerful (and more dangerous) than the porcelain commands, but may give you the flexibility you need to fix this.

The same way you always solve this problem under Windows. You have to rename one of the files, then you can restore the other one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top