Tarballing without git metadata

Posted by zaf on Stack Overflow See other posts from Stack Overflow or by zaf
Published on 2010-06-18T12:24:14Z Indexed on 2010/06/18 12:33 UTC
Read the original article Hit count: 368

Filed under:
|
|
|
|

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.

I thought I'd have a go using a combo of find/egrep/xargs/tar but somehow the tar file contains the .git directories and the *.log files.

This is what I have:

find -type f . | egrep -v '\.git|\.log' | xargs tar rvf ~/app.tar

Can someone explain my misunderstanding here? Why is tar processing the files that find and egrep are filtering?

I'm open to other techniques as well.

© Stack Overflow or respective owner

Related posts about find

Related posts about packaging