How do you browse another branch of your GitHub pages?

My main thread is available on {USERNAME} .imtqy.com. Let's say I create a new branch called "mobile" and make some new commits on the web interface. How can I view a new mobile branch locally without merging it into a master?

+6
source share
2 answers

GitHub pages are built on top of Jekyll , which you can also install and run locally . Short version:

  • Install Ruby
  • Install bundler
  • Install the version of Jekyll that GitHub uses by creating a Gemfile containing

     source 'https://rubygems.org' gem 'github-pages' 

    and bundle install

Once this is done, you can run Jekyll locally in a way that matches the GitHub setting for Pages:

Jekyll Launch

To run Jekyll in a way that matches the GitHub Pages build server, start Jekyll using the Bundler. Use the bundle exec jekyll serve in the root of your repository (after going to the gh-pages branch for project repositories), and your site should be accessible at http://localhost:4000 . For a complete list of Jekyll commands, see the Jekyll documentation.

I believe that you will want to do this from your mobile branch.

+3
source

I, too, had to deal with this and ended up next. My branching strategy is to free myself from the release / version branch. As soon as the new version is cut, I will combine it to create and create the next release branch based on this. The master branch always contains the last / docs content, which seems to be javadocs. Then I advise the reader that if he wants to see the old version of javadoc for cloning the repository locally, check the branch of interest and load docs / index.html into the browser.

0
source

Source: https://habr.com/ru/post/970966/


All Articles