Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git squash是否给出警告/错误?_Git - Fatal编程技术网

Git squash是否给出警告/错误?

Git squash是否给出警告/错误?,git,Git,我有4个提交要合并为一个。 下面是在重新设置基础-i之后出现的内容: pick 43b00e2 test2 pick f046962 Fixed files refreshing forever when list is empty pick 92788fb Fixed files refreshing forever when list is empty pick aef642a fuckgit 当我将其更改为: pick 43b00e2 test2 squash f046962 Fixed

我有4个提交要合并为一个。 下面是在
重新设置基础-i
之后出现的内容:

pick 43b00e2 test2
pick f046962 Fixed files refreshing forever when list is empty
pick 92788fb Fixed files refreshing forever when list is empty
pick aef642a fuckgit
当我将其更改为:

pick 43b00e2 test2
squash f046962 Fixed files refreshing forever when list is empty
squash 92788fb Fixed files refreshing forever when list is empty
squash aef642a fuckgit
我明白了:

D:\Users\Steven\Documents\projects2\Put.io [master]> git rebase -i
warning: LF will be replaced by CRLF in res/drawable/btn_check_putio.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/edit_text_putio.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/putio_clickable_button.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/btn_check_putio.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/edit_text_putio.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/putio_clickable_button.xml.
The file will have its original line endings in your working directory.
error: could not apply 43b00e2... test2

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".
warning: LF will be replaced by CRLF in project.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/btn_check_putio.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/edit_text_putio.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in res/drawable/putio_clickable_button.xml.
The file will have its original line endings in your working directory.
Could not apply 43b00e2... test2

这意味着什么,以及如何正确压缩这些提交?

这就是臭名昭著的CR/LF问题

如何修复?这取决于你的平台。您必须告诉git如何处理行尾


您可能需要从文件中删除LF并将其提交回git。这篇文章解决了你的问题。重点是。。由于您希望压缩提交,因此需要在上述重基步骤中应用修复。

成功!我怀疑是我从Windows7切换到Windows8改变了设置。