-->

Unstaged changes immediately after cloning in Ecli

2019-02-19 01:16发布

问题:

I'm using Atlassian Stash, and the Git plugin for Eclipse Kepler, and I'm trying to clone a repository. As soon as I complete it, I immediately end up with N unstaged changes, where N vary everytime I try it. When I try and compare the two files that are apparently different, there isn't a single change. I'm guessing there may be some differences between the metadata of the files, but since I can't find what exactly has changed I don't want to commit/push the files either. Like I said, the number of files that have changed are completely random, and the kind of files that have been changed are also pretty random. (.project, .java, .groovy, +more).

I have had a look at this question, this question, and this question but none of them solved my question.

Any ideas as to why this happens?

回答1:

Like already mentioned in the comments,this is a line-ending problem.

I also had this issue one day.

The git plugin(egit) you are using does have a issue with .gitattributes where you can configure how line endings should handled. - If you are using the plugin and still want to use it, you need to have to fix the line endings first and than configure your line endings in your IDE to use Unix-Line-Endings, as well as on the other(usually Windows) machine. This will solve the line ending problem for new files.


I am totally against the fact that git should handle your line-endings, you as a developer are responsible for managing this. So let your IDE handle this issue and configure it as already mentioned.