Note that there are some explanatory texts on larger screens.

plurals
  1. POGithub Windows: Working with 'master' and 'gh-pages' branches
    text
    copied!<p>I've got a painfully simple jQuery plugin that I've written and placed on github. I am using Github for Windows and the website itself to manage the project.</p> <p>Unfortunately, if I try to include any of the <code>.js</code> or <code>.css</code> files that I've uploaded there, through the <code>Raw</code> links, it fails in my browser due to the MIME-type being <code>plain/text</code>.</p> <p>So, for the last couple of hours I've been researching how to get a copy of the files, through github, that people (including myself) can link to. The first step seems to be creating a project page (gh-pages branch)... that much I have grasped.</p> <p>However, all of the material I've found so far either expects you to have a UNIX-based system, or do some console-based trickery:</p> <p>Examples: <a href="https://gist.github.com/chrisjacob/833223" rel="nofollow noreferrer">GitHub</a>, <a href="https://stackoverflow.com/questions/7180099/including-js-from-raw-github-com">SO</a>, <a href="https://stackoverflow.com/questions/1705224/github-how-to-include-files-from-master-in-new-git-branch-gh-pages?rq=1">SO</a></p> <p>Now, there <strong>must</strong> be a straightforward way to simply make these source files available for inclusion. I went through the automated steps of creating a 'project page' and now I'm presented with another branch that is claiming to be behind the 'master' branch, but I can't see what I'm supposed to do next. It's not even clear to me why on earth I'm required to make another branch. This whole thing seems far more complicated than it needs to be.</p> <p>So, to recap:</p> <ul> <li>I've created a branch in Github (using Windows app and website)</li> <li>I can manage that, and update my files, without incident</li> <li>I am unable to include the .js and .css files using a 'raw' links</li> <li>I want to be able to include those files in a page</li> <li>I'd like to do this through Github for Windows, or on the site itself</li> </ul> <p>If anyone could help walk me through this, I'd appreciate it. Also, I'd expect that <strong>A LOT</strong> of others would as well.</p> <p><strong>EDIT:</strong> Here is an example of a well-known Github project that has its files available through Github:</p> <p><a href="http://ivaynberg.github.io/select2/" rel="nofollow noreferrer">Select2</a>: <a href="http://ivaynberg.github.io/select2/select2-3.4.2/select2.js" rel="nofollow noreferrer">http://ivaynberg.github.io/select2/select2-3.4.2/select2.js</a></p> <p><strong>EDIT2:</strong> Okay, conceptually, I now understand why I have to create a separate branch, in order to share the files - as the source control aspects of Github aren't meant to act as a CDN, the project page simply provides a public website where you can place your files. So the question now becomes: <em>How do I put my files from the master branch into the gh-pages branch?</em> I'm not worried about automating it or anything right now, all I want is access to the directory structure so I can place files in there. I've tried syncing and re-syncing my branch with Github Windows, but it tells me that there's nothing to get from the gh-pages branch, even though it's "10 commits behind". What is going on?</p> <p><strong>EDIT3:</strong> Added my own answer, for what I've come up with (so far).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload