title: git alias for creating a .gitattributes on init - how do I add the new lines?
body: <p>My latest iteration</p>
  
  <pre><code>jinit= !git init &amp;&amp; printf "* text=auto\n*.java text\n*.jsp text\n*.css text\n*.html text\n*.js text\n*.xml text\n*.sql text\n*.MF text\n*.tld text\n*.md text\n\n# git files\n*.gitignore text\n*.gitattributes text\n\n# eclipse files\n*.classpath text\n*.project text\n*.prefs text\n*.properties text\n*.component text\n" &gt;&gt; .gitattributes &amp;&amp; echo "bin/" &gt;&gt; .gitignore &amp;&amp; git add .
  </code></pre>
  
  <p>This will actually try to execute the lines in gitattributes ! Changing <code>\n</code> for <code>\r\n</code> will crash the script and for <code>\\\n</code> will successfully run the script albeit the gitattributes will only contain </p>
  
  <blockquote>
    <p>*</p>
  </blockquote>
  
  <p>So how do I echo this with new lines ? Windows, mingwin, msysgit</p>
  
  <p>EDIT : I also tried single quotes</p>
  
  <p></p>
  
  <p><strong>EDIT 2014.03.13</strong>: </p>
  
  <pre><code>jinit= !git init &amp;&amp; `echo '* text=auto\n\n*.java text\n*.jsp text\n\
  *.css text\n*.html text\n*.js text\n*.xml text\n*.sql text\n*.MF text\n\
  *.tld text\n*.md text\n\n*.gitignore text\n*.gitattributes text\n\n\
  *.classpath text\n*.project text\n*.prefs text\n*.properties text\n\
  *.component text\n' &gt;&gt; .gitattributes` &amp;&amp; `echo "bin/" &gt;&gt; .gitignore` 
  </code></pre>
  
  <p><strong>EDIT 2014.03.14</strong>: using <code>\</code> to wrap the command - still works but a space is introduced before *.css, *.tld, *.classpath and *.component.</p>
  
  <p>Can't seem to manage echoing comments. So if I add <code>\n# git files\n\*.gitignore text\n (...)</code> it EOFs - any workaround for that ?</p>
  
  <p>Finally I used a different approach (see comments):</p>
  
  <pre><code>jinit= !git init\
      &amp;&amp; `ln /c/Dropbox/_/_git/java_eclipse.gitattributes .gitattributes`\
      &amp;&amp; `echo "bin/" &gt;&gt; .gitignore`\
      &amp;&amp; git add .
  </code></pre>
  
  <p>but I leave this open for now, for the syntactic part</p>