1

I recently had a problem wit git couldn't merge because of HEAD and these files. (Netbeans said)

So I tried doing it with Git Bash and it gave me some errors about .DS_Store. So I removed those files and now when I try to merge, almost all files have the text "both modified" even though they seems to be the exact same.

@@@ -1,10 -1,10 +1,22 @@@
 -<html>

 -<head>

 -  <title>403 Forbidden</title>

 -</head>

 -<body>

 -

 -<p>Directory access is forbidden.</p>

 -

 -</body>

  <<<<<<< HEAD
 +<html>
 +<head>
 +  <title>403 Forbidden</title>
 +</head>
 +<body>
 +
 +<p>Directory access is forbidden.</p>
 +
 +</body>
  =======
++<html>
++<head>
++  <title>403 Forbidden</title>
++</head>
++<body>
++
++<p>Directory access is forbidden.</p>
++
++</body>
  >>>>>>> 4dd01fd4
  </html>

But it seems like it's adding an extra intent?

How can I solve this?

madth3
  • 7,275
  • 12
  • 50
  • 74
Muqito
  • 1,369
  • 3
  • 13
  • 27

1 Answers1

3

I assume this is because of different line endings (carriage return(\r)/newline(\n)) in the files. Check if they are consistent.

I think the old file has been saved under Windows(\r\n).

weitho
  • 80
  • 1
  • 9
  • Yes, we're a few developers, some on mac and some on Windows. Have any idea? :) – Muqito Feb 21 '13 at 16:34
  • 3
    Best is you set you editors to use the same line endings. Or you could make git manage them for you: https://help.github.com/articles/dealing-with-line-endings – weitho Feb 21 '13 at 16:38
  • I can't get this to work :( I've tried setting it up both in netbeans and git bash – Muqito Feb 21 '13 at 17:29