Search code examples
gitgitlabgit-mergegit-difffeature-branch

how to remove git compare - + diff, the content is exact the same


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?


Solution

  • 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