Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github release zip containing only partial code from repo

while the Github provide a way to releasing software, I don't know if possible to specify just some files of the current master repository to be released and be downloaded as a zip file.

I want to offer users the possibility to download a certain folder/files from the whole repository, like say; I have 3 files in my repoo, file_1.js, file_2.js, file_3.js - I want to make file_3.js a downloadable release as a zip file my_app_v1.0.zip.

How is that possible?

Thanks for any ideas :)

like image 374
numediaweb Avatar asked Sep 13 '14 11:09

numediaweb


People also ask

How do I download a subdirectory from GitHub?

Step1: Input github url to the field at the top-right. Step2: Press enter or click download for download zip directly or click search for view the list of sub-folders and files. Step3: Click "Download Zip File" or "Get File" button to get files.


2 Answers

while the Github provide a way to releasing software, I don't know if possible to specify just some files of the current master repository to be released and be downloaded as a zip file.

How is that possible?

Thanks for any ideas :)

When a new release is created, the github platform creates for us two downloadable zipped files: Source code (.zip) and Source code (.tar.gz) both containing the whole repository source code. The above created files can't be deleted by user using the online user interface (www.githuh.com). So let's go on.

When you create or edit a release, you can upload any kind of files from your hard drive (you can't link files from your github repo to the release, in other words, you have to download the files from repo to your hard drive!!). In other words, you can upload what files as you want. BUT, folders!!! ;-)

If you have already created the release, you can click "Edit release" to manage (add/remove) files attached to your release.

In summary, the idea is:

  1. creating, in your hard drive, a zip file containing what you want from your repository;
  2. upload the created zip file by click on create/edit release buttons.
like image 171
baudo2048 Avatar answered Nov 15 '22 05:11

baudo2048


The release is a way to attached binaries to a tag in your Git repo (in addition of the archive of the source code itself).
You can attach as many binaries as you want, which means you can build and package as many releases as you need.
One of those binaries can include a partial set of your repo codebase, should you chose to package it that way.

But a release isn't dynamically packaged, and it doesn't necessarily include the repo sources. It generally include the result of a repo build. Or any other element that you want to be part of a release.

like image 41
VonC Avatar answered Nov 15 '22 05:11

VonC