title: Create a new file in git bash
body: <p>I've got Git for Windows running, I'm not sure if it's supposed to function as a text editor though?</p>
  
  <p>I think I installed it with the Vim editor, but in a Git Bash shell how do I create a file, such as webpage.html?</p>
  
  <pre><code>$ git add webpage.html
  </code></pre>
  
  <p>comes back as</p>
  
  <pre><code>fatal: pathspec 'webpage.html' did not match any files
  </code></pre>
  
  <p>because it tries to track a non-existing file.</p>
  
  <p>I understand I can create a new file on the github.com interface, that's easy enough, I'm wondering if I can create a new file (like echo in cmd) and whether this file will actually be blank (<a href="https://stackoverflow.com/questions/1702762/how-to-create-an-empty-file-at-the-command-line">echo in cmd creates non-blank files</a>) and how I can write into that file from the git bash shell?</p>
  
  <p>If not, I'm guessing I should just create a new file in windows explorer? Is that the norm...?</p>
  
  <h3><strong>Edit</strong></h3>
  
  <p>Wow, I was new to all this when I asked the above. No, Git Bash isn't a text editor, it's a Windows version of the <code>git</code> facility on Unix, and only handles the file versioning. <code>git add</code>, <code>git rm</code>, and other <code>git</code> commands just handle how the version control file manager handles the files and folders, and the only things it changes as a result are in a hidden folder named <code>.git</code>. Sorry if this has confused anyone.</p>
  
  <p>I was confused at the time because, as the name suggests, Git Bash has bash shell commands shipped with it, not just <code>git</code> - e.g. <code>ls</code> (list files), <code>mkdir</code> (make new folder), and -- what I was looking for -- <code>touch</code> (make a new file or update timestamp on existing file), and <code>echo</code> (print text to the command line, or direct that text to a file). </p>
  
  <p>I could have made my new file <code>webpage.html</code> with:</p>
  
  <pre><code>touch webpage.html
  </code></pre>
  
  <p>Then written to it with:</p>
  
  <pre><code>echo "&lt;!DOCTYPE html&gt;" &gt; webpage.html
  </code></pre>
  
  <p>Then appended lines to it with:</p>
  
  <pre><code>echo "&lt;html" &gt;&gt; webpage.html
  echo "&lt;head&gt;" &gt;&gt; webpage.html
  </code></pre>
  
  <p>and so on - but I don't think there's any text editor (according to <a href="http://www.codeproject.com/Articles/457305/Basic-Git-Command-Line-Reference-for-Windows-Users" rel="noreferrer">this list of commands</a>). See <a href="https://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows">this thread</a> for details of setting up a text editor with Git on Windows.</p>