0

I have 4 commits that I want to merge into one. Here's what comes up after rebase -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

When I change it to:

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

I get this:

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

What does this mean, and how can I properly compact these commits?

Steven Schoen
  • 4,366
  • 5
  • 34
  • 65

1 Answers1

1

That's the infamous CR/LF issue.

What's the best CRLF (carriage return, line feed) handling strategy with Git?

How to fix? well it depends on your platform. You have to tell git how to handle line endings.

You will likely need to strip the LF from the files and commit them back into git. The article has the solution to your issue. The point is.. since you want to squash commits, you will need to apply the fix during the rebase step described above.

Community
  • 1
  • 1
Olivier Refalo
  • 50,287
  • 22
  • 91
  • 122