GitHub – How to Exclude README.md from Download Zip

github

So I'm pretty new to GitHub and I've spent the last 2 days getting to grips with it and frankly it's awesome! but you all know that already! anyhow…

I'm under the impression that you need a README.md for the page description but I have run into a problem with one of my projects and I'll do the best I can to explain the issue.

When developing Joomla plugins, modules or components your zip files need to have a folder within the zip with all your files. This causes a problem, the license and README.md file are contained outside of the parent folder, meaning when people click to download zip they get the add-on but they are unable to install it without deleting those two files beforehand.

Now correct me if I'm wrong if I use a .gitignore this will only stop tracking locally for adds, commits and pushes, not excluding those files within the download zip file.

You can view my Joomla Webmaster Site Verification Plugin on GitHub which should give you an idea what I'm talking about. Ideally, I'd like to have a page description but exclude both README.md and license when people click the download button, as they may want to install from GitHub using remote URL method.

Looking for either a workaround or a fix.

Best Answer

READMEs are very important to GitHub repos, and you've used yours well so I would recommend against adding those files to your .gitignore.

Instead, I would recommend using GitHub releases and provide the "clean" zip file there. You could also use your README to point to the latest release download link when you get that setup.