title: Telling git to ignore symlinks
body: <p>This question has appeared in similar forms <a href="https://stackoverflow.com/questions/5917249/git-symlinks-in-windows">here</a> and <a href="https://stackoverflow.com/questions/5190170/ignoring-symlinks-in-git">here</a>, but they don't seem to match up with what I'm looking for.</p>
  
  <p>I'm making a project in StaticMatic, a Ruby static site generator. Basically, it's just a src/  directory with Haml templates, Sass, and CoffeeScript. StaticMatic provides a development server to keep compiling these into a static site, as well as a build command that generates the static site in build/.</p>
  
  <p>My modification to StaticMatic is to allow the addition of src/_modules/foo/, which might contain src/_modules/foo/bar.haml. When running the server or building the site, a symlink would be created at src/bar.haml which points to the file in foo/.</p>
  
  <p>So far so good. (Conflicts are handled, etc.)</p>
  
  <p>The reasoning behind separate directories in _modules/ is that they could be tracked as git submodules and checked out independently by other teams. Essentially, this allows multiple teams to work on different pages (actually JS apps) in one static site without duplicating the main layout and such.</p>
  
  <p>The hitch is that git wants to think of these symlinks as files. For instance, <code>git status</code> shows:</p>
  
  <pre><code># On branch master
  # Untracked files:
  #   (use "git add &lt;file&gt;..." to include in what will be commited)
  #
  #       src/_modules/bar/foo.haml
  #       src/foo.haml
  </code></pre>
  
  <p>...when I really just want it to show <code>src/_modules/bar/foo.haml</code> and to ignore <code>src/foo.haml</code></p>
  
  <p>One approach would be to have my link-generating code append the links to .gitignore, but messing with .gitignore programmatically strikes me as prone to error. (Perhaps this concern isn't reasonable?)</p>
  
  <p>My ideal fix would be something like:</p>
  
  <pre><code>[filetype = link]
  </code></pre>
  
  <p>...in .gitignore. As far as I know nothing like this is possible, or is it?</p>