Search code examples
gitubuntudebianpackagingdpkg

Set debuild/dpkg to always ignore .git directories


To distribute my Ubuntu packages, I use debuild -S to create the source package and then upload it to launchpad, which creates the binary packages. This is very convenient. However, I noticed that my source packages are growing quickly in size, due to the fact that all of my packages contain a .git directory which is included in all the source packages.

What would be a way to set a global option so that debuild/dpkg always skips any .git directories when creating a source package?


Solution

  • You could use something like this

    git archive master | tar -x -C /somewhere/else
    

    and then create the .deb from /somewhere/else which should not include a .git directory