Mysterious Dan
Mysterious Dan

Reputation: 1326

How safely remove '.' entry from git tree?

I used the Git.Unite tool (http://www.woodcp.com/2013/01/git-unite-fix-case-sensitive-file-paths-on-windows/) to merge paths in my git repo that differed only in case, and while it succeeded at that, it also seems to have added a '.' entry to my repository. Of course, when I clone the repo to my local machine, the '.' is invisible (since there's the OS-provided virtual entry) but when I browse the repo in github, I can see a '.' entry that unsurprisingly points to the current directory. It seems silly and confusing that the entry is there, but I also don't know how to delete it, since saying git rm . doesn't quite have the right meaning.

What can I do to get rid of this bogus entry?

Edit: to be clear, the problem seems to be that the tool expressed the renames as Foo/Bar.txt -> ./Foo/Bar.txt, which created an explicit '.' entry.

Edit 2: I just remembered that git doesn't explicitly store directory entries, so I think github is only showing . because I have a few files that are represented in the tree with a path starting with .. I'll probably just remove and re-add those files for now, since git mv won't let me rename them.

Upvotes: 1

Views: 255

Answers (1)

tawman
tawman

Reputation: 2498

I found an issue with Git.Unite when running the tool against the current directory by passing '.' as the path argument:

C:\demo [master]> C:\tools\Git.Unite.exe .

As you observed, it was issuing an index move targeting the leading ./directory name. I have pushed up a fix to my Git.Unite repository that resolves the user passed path to the full directory name in order to avoid this problem.

To correct your repository, git reset --hard HEAD~ to before the commit after running Git.Unite and re-run the new build of Git.Unite.

If you run into any issues, please open a GitHub issue to expedite the fix. Thanks for the feedback and hope the tool helps out.

Upvotes: 2

Related Questions