如何解决与Windows上的Git文件夹大小冲突? [英] How do I solve a folder capitalization conflict with Git on Windows?

查看:127
本文介绍了如何解决与Windows上的Git文件夹大小冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一个git rebase,而且我被卡住了,因为在一次提交中我有一个名为Proto的文件夹,但在另一个提交中我有一个名为proto的文件夹。这是一个诚实的错误,在两种情况下都应该是Proto。我可以在这里找到的最好的办法是尝试从两次提交中删除文件夹,然后再次尝试rebase,但必须有更好的方法。



过去,当我遇到一个文件的大写问题时,我已经使用了git mv,但是对于该文件夹,它不会让我运行git mv,而我不知道为什么。



在Windows上用git修复文件夹大写问题的正确方法是什么?

解决方案

在大量文件移动到不同的目录时,我们在Windows上的git存储库中出现类似的问题。



我第一次通过将存储库克隆到Linux VM并使用 git mv 命令运行bash脚本来修复文件路径大小写问题。这是一个痛苦的过程,所以我决定开发一个实用程序来自动化这个过程。

Git Unite 是一个使用 libgit2sharp 库。该程序识别所有与Windows文件系统报告的文件路径大小写不同的git索引条目。



我写了一篇博文,详细介绍了它背后的工具,用法和历史在 Git Unite - 修复案例Windows上的敏感文件路径


I'm doing a git rebase, and I'm stuck because in one commit I have a folder named Proto, but in the other commit I have a folder named proto. It was an honest mistake and should have been Proto in both cases. The best I can figure out here is to try deleting the folder from both commits and then trying the rebase again, but there has to be a better way.

In the past, when I've run into capitalization problems with a file, I've used git mv, but with the folder it won't let me run git mv, and I don't know why.

What's the correct way to fix a folder capitalization problem in git on Windows?

解决方案

We encountered a similar issue in our git repository on Windows when a large number of files were moved around to different directories.

I fixed our issue the first time manually by cloning the repository to a Linux VM and running a bash script with git mv commands to fix the file path case issue. This was a painful process so I decided to develop a utility that automates the process.

Git Unite is a .NET console application I wrote using the libgit2sharp library. The program identifies all git index entries with file path case different from what the Windows file system reports.

I wrote a blog posting detailing the tool, usage, and history behind it at Git Unite - Fix Case Sensitive File Paths on Windows

这篇关于如何解决与Windows上的Git文件夹大小冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆