Thursday, March 7, 2019

Exclude files from being exported into the zip/tar source archives on (and probably GitLab too) provides various ways to export the Git branch contents or tags and releases as Zip- or Tar-archives. When creating a release, these tar-/zipballs are automatically created and added to the release. I often find archives, which contain a lot of files not useful to the end user, like .github directories, Git (.gitignore, .gitattributes) or CI related files (.travis.yml, .appveyor.yml). Sometimes they also contain directories (e.g. for test files), upstream hosts in Git, but does not need for the source distribution. But there is an easy way to keep these files out of the automatically created source archives and keep the latter clean by using the export-ignore attribute in the .gitattributes files:

# don't export the github-pages source
/docs export-ignore
# export some other irrelevant directories
/foo export-ignore
# don't export the files necessary for CI
Gemfile export-ignore
.appveyor.yml export-ignore
.travis.yml export-ignore
# ignore Git related files
.gitattributes export-ignore
.gitignore export-ignore


  1. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. direktfahrt

  2. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! Bonuses

  3. Great things you’ve always shared with us. Just keep writing this kind of posts.The time which was wasted in traveling for tuition now it can be used for studies.Thanks visit here

  4. charming post, remain mindful of this intriguing work. It genuinely respects understand that this subject is being verified moreover on this site so cheers for putting aside time to discuss this! SuperSU ZIP

  5. Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. Profi Fachübersetzungen GmbH

  6. Nice and thanks for sharing intreseting information keep it up...

  7. Hey, ich lese Ihren Blog von Zeit zu Zeit und ich habe einen ähnlichen und ich war neugierig, ob Sie eine Menge von Spam-Antworten bekommen? Wenn ja, wie verhindern Sie das, gibt es irgendwelche Add-ons oder andere Tipps? Ich habe in letzter Zeit so viel bekommen, dass es mich verrückt macht, also ist jede Hilfe sehr willkommen. spanischer