0

I have a feature branch and created a merge request, in the compare section, it shows me:

enter image description here enter image description here

Pink is what dev branch looks like, green is my branch, the content on line 9 are exact the same, how can I modify my branch to make this diff disappear?

wawawa
  • 2,835
  • 6
  • 44
  • 105
  • Are you sure the lines are exactly the same including whitespaces (space vs tabs) and end-of-lines (LF, CR, CR+LF)? Try `git diff --ignore-all-space` – phd Aug 27 '20 at 11:40
  • I used notepad++, there are CR_LF on the left, that's the reason, thanks. – wawawa Aug 27 '20 at 12:16

1 Answers1

2

The actual diff is displayed as a comment :

\ No newline at end of file

Fix : add (and save) an empty line at the end of your file ...


Some text editors automatically remove the last line of a file on save if it is empty.

One way to revert the file to the version that was stored in git at version eacf32 is :

git checkout eacf32 -- file
LeGEC
  • 46,477
  • 5
  • 57
  • 104