为什么EGit在新克隆的存储库中显示不受限制的更改? [英] Why is EGit showing unstaged changes in a freshly cloned repository?

查看:176
本文介绍了为什么EGit在新克隆的存储库中显示不受限制的更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows Server 2003上运行,并使用Cygwin版本的Git命令行工具。



我有一个包含一组Eclipse的Subversion存储库项目,并正在测试此存储库迁移到Git。从命令行我已经使用 git svn 创建git存储库,并且 git clone 来克隆新的存储库本地。在Eclipse中,我使用导入向导Import-> Projects from Git-> Existing local repository从本地克隆导入项目。



项目导入后,EGit显示源文件的显式随机选择具有未更改。比较文件显示与Git版本没有差异,用HEAD版本替换文件没有任何效果。

解决方案

在很多头痛之后,我追踪了这个问题。



在原始的Subversion版本库中,已经使用Subversion svn:executable 属性集。该属性由 git svn 授予,当该文件最终显示在Git工作目录中时,它具有执行权限属性集。即使这是文件在Git中的配置方式,EGit看起来好像没有看到存储库中的权限集,并且将它与存储库副本和工作副本之间的区别对待,因此它出现在未修改的更改。



我只是在Cygwin bash shell的受影响的文件上使用 chmod -x 并承诺改变。我知道设置Git属性 core.filemode = false 也应该解决问题,虽然我还没有尝试这个。


I'm running this on Windows Server 2003, and using the Cygwin version of the Git command line tools.

I have a Subversion repository containing a set of Eclipse projects, and am testing migration of this repository into Git. From the command line I've used git svn to create the git repository, and git clone to clone the new repository locally. In Eclipse I use the import wizard "Import->Projects from Git->Existing local repository" to import the projects from the local clone.

Once the projects have been imported, EGit shows an apparently random selection of source files as having unstaged changes. Comparing the files reveals no differences with the version in Git, and replacing the file with the HEAD revision has no effect.

解决方案

Eventually after much head-scratching I tracked down the problem.

In the original Subversion repository, a number of source files had been checked in with the Subversion svn:executable property set. This property is honoured by git svn, and when the file is ultimately presented in the Git working directory it has the execute permission property set. Even though this is how the file is configured in Git, EGit looks like it isn't seeing the permission set in the repository and is treating it a difference between the repository copy and the working copy... hence it appears in the list of unstaged changes.

I fixed the issue simply using chmod -x on the affected files from the Cygwin bash shell, and committed the changes. I understand that setting the Git property core.filemode=false should also resolve the issue, although I've yet to try this.

这篇关于为什么EGit在新克隆的存储库中显示不受限制的更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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