title: Tarballing without Git metadata
body: <p>My source tree contains several directories which are using Git source control, and I need to tarball the whole tree excluding any references to the Git metadata or custom log files.</p>
  
  <p>I thought I'd have a go using a combination of find/egrep/xargs/tar, but somehow the tar file contains the .git directories and the *.log files.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>find -type f . | egrep -v '\.git|\.log' | xargs tar rvf ~/app.tar
  </code></pre>
  
  <p>Can someone explain my misunderstanding here? Why is tar processing the files that find and egrep are filtering?</p>
  
  <p>I'm open to other techniques as well.</p>