title: Line endings with Git
body: <p>I have setup a Jenkins job which will execute a <code>build.sh</code> from my repository. The job starts and exits with the following error:</p>
  
  <blockquote>
    <p>d:\jenkins\workspace\test-win7>c:\cygwin64\bin\bash.exe -xe build.sh 
    + $'\r' 
    build.sh: line 2: $'\r': command not found</p>
  </blockquote>
  
  <p>I found out that this occurs because of a problem with line endings. I have written my <code>build.sh</code> in Notepad++ with CRLF endings. And I used a .gitattributes file with the following options but none of them work. I also saved my file with LF endings and committed them but still this error wont go away. Could anyone be kind enough to explain to me how this line endings system work? What setting should I keep in my <code>.gitattributes</code> file so that my builds run on Jenkins AND my friends who pull from my Repo are not affected.</p>
  
  <ul>
  <li><code>*.sh text eol=crlf</code></li>
  <li><code>* text=auto</code></li>
  <li><code>*.sh text eol=lf</code></li>
  </ul>
  
  <p>My jenkins build node is a windows node. I do my development in Eclipse in a Windows local machine. </p>