0

Scenario: As the project currently exists, master and gh-pages are completely separate (gh-pages started as an orphan, doesn't share any code with master). The gh-pages branch has grown to include javascript code to run a client-side simulation.


At this point, it makes sense to move the simulation code to master (it's now a feature of the project, unit testing, central location, etc).

How could I automatically push certain files from master to specified locations in gh-pages?

Or, more generally, how would you manage this scenario?

1 Answers1

0

As mentioned in "Sharing files across branches in Git", you could consider isolate that set of javascript code (with its unit testing) in its own git repo.

That would allow you to reference that repo both in the master branch and in the gh-branch of your main repo as:


Update August 2016: Simpler GitHub Pages publishing now allows to keep your page files in a subfolder of the same branch (no more gh-pages needed):

Now you can select a source in your repository settings and GitHub Pages will look for your content there.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250