Git Pull请求表示每个文件都已更改,但每个文件中没有更改

Git Pull请求表示每个文件都已更改,但每个文件中没有更改,git,github,pull-request,Git,Github,Pull Request,我的Pull请求表明我已经更改了7188个文件,几乎所有这些文件都没有实际更改。我的实际更改是大约10个文件 我是怎么进入这个奇怪的git状态的,我又是怎么出来的 您是否设置了类似autoctrl的功能?如果是这样,您可能已经更改了所有这些文件的EOL格式。我一定要写一篇关于这个的博客文章,告诉人们不要使用它。。。曾经曾经使用.gittributes告诉git不要弄乱EOL格式: * -text 那应该可以。。。。要更正您弄糟的此修订,请执行以下操作: # first, make sure t

我的Pull请求表明我已经更改了7188个文件,几乎所有这些文件都没有实际更改。我的实际更改是大约10个文件

我是怎么进入这个奇怪的git状态的,我又是怎么出来的


您是否设置了类似autoctrl的功能?如果是这样,您可能已经更改了所有这些文件的EOL格式。我一定要写一篇关于这个的博客文章,告诉人们不要使用它。。。曾经曾经使用.gittributes告诉git不要弄乱EOL格式:

* -text
那应该可以。。。。要更正您弄糟的此修订,请执行以下操作:

# first, make sure that you have setup .gitattributes appropriatetly
git checkout HEAD~1 -- . # got the content back of all the files as they where on the previous revision (don't worry you won't lose your work, because you already committed it, right?).
# set up .gitattributes appropriately _again_ because it was probably cleared by the previous command
# now, get the list of files that actually had something meaningful
git status -w
# the files that are listed there are the files that should have been committed before
# check them out and be ready to change their EOL to what it was on the original revision
git checkout HEAD -- file1 file2 file3
# make sure that the eol format is not busted. If you run git diff HEAD~1 you should only see the real changes that you applied, not the whole files getting cleared and then having full content readded
git add .
# now we amend the revision to how it should have been 
git commit --amend --no-edit
# push -force if required

您现在可以开始了。

您是否设置了类似autoctrl的功能?如果是这样,您可能已经更改了所有这些文件的EOL格式。我一定要写一篇关于这个的博客文章,告诉人们不要使用它。。。曾经曾经使用.gittributes告诉git不要弄乱EOL格式:

* -text
那应该可以。。。。要更正您弄糟的此修订,请执行以下操作:

# first, make sure that you have setup .gitattributes appropriatetly
git checkout HEAD~1 -- . # got the content back of all the files as they where on the previous revision (don't worry you won't lose your work, because you already committed it, right?).
# set up .gitattributes appropriately _again_ because it was probably cleared by the previous command
# now, get the list of files that actually had something meaningful
git status -w
# the files that are listed there are the files that should have been committed before
# check them out and be ready to change their EOL to what it was on the original revision
git checkout HEAD -- file1 file2 file3
# make sure that the eol format is not busted. If you run git diff HEAD~1 you should only see the real changes that you applied, not the whole files getting cleared and then having full content readded
git add .
# now we amend the revision to how it should have been 
git commit --amend --no-edit
# push -force if required

您可以开始了。

更改在文件权限中。您没有说明是否在Windows、Linux或OS X上签出了文件,也没有说明使用了什么客户端,但您可能应该将core.filemode设置为false,然后再次克隆项目

git config core.filemode false

请参阅的core.filemode部分。

更改在文件权限中。您没有说明是否在Windows、Linux或OS X上签出了文件,也没有说明使用了什么客户端,但您可能应该将core.filemode设置为false,然后再次克隆项目

git config core.filemode false
请参阅的core.filemode部分