title: Convert .gitignore to rsync merge filter include file? (with sed or awk)
body: <p>I tried using rsync <code>--filter=':+ .gitignore'</code>  (<a href="https://stackoverflow.com/a/15373763/790359">-/exclude works but not include</a>) to no avail.</p>
  
  <p>Basically i just want to include the .ignore file in a script and upload everything in it with rsync to the remote.</p>
  
  <p>If anyone would have the skills to sed or awk .gitignore  into  a file suitable for include with <code>--filter='merge file'</code>  etc it would me much appreciated!</p>
  
  <p>Or alternatively a way just to make rsync understand .gitignore for inclusion.</p>
  
  <p><a href="https://www.kernel.org/pub/software/scm/git/docs/gitignore.html" rel="nofollow noreferrer">https://www.kernel.org/pub/software/scm/git/docs/gitignore.html</a> 'PATTERN FORMAT'</p>
  
  <p><a href="http://linux.die.net/man/3/fnmatch" rel="nofollow noreferrer">http://linux.die.net/man/3/fnmatch</a></p>
  
  <p><a href="https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.txt;hb=HEAD" rel="nofollow noreferrer">https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.txt;hb=HEAD</a></p>
  
  <p><a href="https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.c;hb=HEAD" rel="nofollow noreferrer">https://git.samba.org/?p=rsync.git;a=blob_plain;f=wildtest.c;hb=HEAD</a></p>
  
  <p>Some Issues are in rsync <code>bla/</code> means just that dir, <code>bla/*</code> means just the files in that dir, <code>bla/**</code> means just everything under that dir (including subdirs)  and <code>bla/***</code> finally means bla and all it's contents but all git might have is <code>bla/</code></p>
  
  <p>But <a href="https://stackoverflow.com/a/15373763/790359">exclude rules</a> seem compatible.</p>