Thursday, March 7, 2019

Exclude files from being exported into the zip/tar source archives on github.com

GitHub.com (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

6 comments:

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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete