🌐
npm
npmjs.com › package › gh-pages-cli
gh-pages-cli - npm
Calling this function will create a temporary clone of the current repository, create a gh-pages branch if one doesn't already exist, copy over all files from the base path, or only those that match patterns from the optional src configuration, commit all changes, and push to the origin remote.
      » npm install gh-pages-cli
    
Published   May 08, 2015
Version   0.2.0
Author   Tim Schaub
🌐
GitHub
github.com › tschaub › gh-pages
GitHub - tschaub/gh-pages: General purpose task for publishing files to a gh-pages branch on GitHub · GitHub
The CLI expects a file exporting the beforeAdd function · gh-pages --before-add ./cleanup.js ·
Starred by 3.3K users
Forked by 204 users
Languages   JavaScript 97.6% | Shell 2.3%
Discussions

node.js - Why won't git bash recognize gh-pages as a valid command after npm installing gh-pages? [GatsbyJS, GitHub Pages] - Stack Overflow
If you wish to invoke gh-pages via the cli, here are two options. More on stackoverflow.com
🌐 stackoverflow.com
Add gh prompt to set up gh pages
Problem In order to set up a gh pages for your repo, you have to do it through the website afaik. Solution Within the gh [flags] format, I'd suggest pages eit... More on github.com
🌐 github.com
4
July 20, 2021
deployment - Error deploying Angular4 to ghpages using angular-cli-ghpages - Stack Overflow
I am trying to deploy a simple Angular 4 app to gh-pages. I have tried several methods and it seems that angular-cli-ghpages is the most up to date way to do it. I've followed the instructions on t... More on stackoverflow.com
🌐 stackoverflow.com
git branch: gh-pages - Stack Overflow
I have a repo on GitHub. Recently I have discovered GitHub's pages and I want to use them. I would like to create this new branch and then, when I need to, either commit on master branch or on gh-p... More on stackoverflow.com
🌐 stackoverflow.com
🌐
npm
npmjs.com › package › gh-pages
gh-pages - npm
January 2, 2025 - Calling this function will create a temporary clone of the current repository, create a gh-pages branch if one doesn't already exist, copy over all files from the base path, or only those that match patterns from the optional src configuration, commit all changes, and push to the origin remote.
      » npm install gh-pages
    
Published   Jan 02, 2025
Version   6.3.0
🌐
npm
npmjs.com › package › angular-cli-ghpages
angular-cli-ghpages - npm
January 8, 2026 - Deploy your Angular app to GitHub Pages, Cloudflare Pages or any other Git repo directly from the Angular CLI! 🚀 ... A detailed changelog is available in the releases section. angular-cli-ghpages v3 supports Angular 18 to 21.
      » npm install angular-cli-ghpages
    
Published   Jan 08, 2026
Version   3.0.2
Author   Angular.Schule
🌐
GitHub
github.com › cvan › ghpages
GitHub - cvan/ghpages: a CLI tool to easily deploy your current working branch to GitHub Pages
A command-line tool to easily deploy your current working branch to GitHub Pages. Usage $ ghpages Options -p, --path Path (directory to push; defaults to current directory) -r, --repo Repository (GitHub username, GitHub username/repo, full repo ...
Starred by 20 users
Forked by 5 users
Languages   JavaScript 99.7% | HTML 0.3% | JavaScript 99.7% | HTML 0.3%
🌐
DEV Community
dev.to › scc33 › deploying-to-github-pages-using-gh-pages-2d95
Deploying to GitHub Pages using gh-pages - DEV Community
October 7, 2023 - It automates the process of pushing your static assets to the gh-pages branch of your GitHub repository, which is then automatically published by GitHub Pages. This package is often used in combination with site generators or build tools to ...
🌐
DEV Community
dev.to › chrissiemhrk › how-to-deploy-your-website-to-github-pages-1mnm
How to deploy your website to Github pages - DEV Community
September 2, 2020 - This script will deploy to Github pages anything in the src directory. You can change src to the name of the directory containing the files you want to deploy. Next, run the publish script in your command line to deploy to gh-pages.
Top answer
1 of 2
1

See https://www.npmjs.com/package/gh-pages#basic-usage

What you need to do is create a js script to use the module. I would suggest you create it under a scripts directory under the root of your project.

Paste the code you need to run. I recommend the following for configuring uploading to a public directory:

ghpages.publish( 'public', { branch: 'master', repo: '', }, () => { console.log('Deploy Complete!') } )

Enter your repo property. => defines the callback function outputting to the console.

Next, open package.json under the root of your project directory. You will see "scripts" defined with default Gatsby scripts, you will need to add one for deployment.

Add the following at the end: deploy:github": "npm run build && node ./scripts/deploy-github"

Save the file, execute npm run and you will see the list of scripts you can execute. Execute npm run deploy:github when you want to deploy.

2 of 2
0

If you wish to invoke gh-pages via the cli, here are two options.

Option A: Install gh-pages globally

npm install gh-pages --global

gh-pages --help

By default, npm install places packages in the local ./node_modules/ directory. By using the --global switch, you can change that behavior so you can access the command more conveniently.

global

  o Default: false

  o Type: Boolean

  Operates in "global" mode, so that packages are installed into the prefix folder instead  of  the  current  working
  directory. See npm help folders for more on the differences in behavior.

  o packages are installed into the {prefix}/lib/node_modules folder, instead of the current working directory.

  o bin files are linked to {prefix}/bin

  o man pages are linked to {prefix}/share/man

Option B: Invoke gh-pages locally

npm install gh-pages --save-dev

node node_modules/gh-pages/bin/gh-pages.js --help

This same command you ran, as suggested in the Gatsby Docs. It is then followed by a direct invocation of the full path to the local gh-pages.js.

🌐
GitHub
github.com › afc163 › gh-pages-cli
GitHub - afc163/gh-pages-cli: General purpose task for publishing files to a gh-pages branch on GitHub
Calling this function will create a temporary clone of the current repository, create a gh-pages branch if one doesn't already exist, copy over all files from the base path, or only those that match patterns from the optional src configuration, commit all changes, and push to the origin remote.
Author   afc163
Find elsewhere
🌐
GitHub
github.com › angular-schule › angular-cli-ghpages
GitHub - angular-schule/angular-cli-ghpages: 🚀 Deploy your 🅰️Angular app to GitHub pages, Cloudflare Pages or any other Git repo directly from the Angular CLI! Available on NPM.
Deploy your Angular app to GitHub Pages, Cloudflare Pages or any other Git repo directly from the Angular CLI! 🚀 ... A detailed changelog is available in the releases section. angular-cli-ghpages v3 supports Angular 18 to 21.
Starred by 981 users
Forked by 98 users
Languages   TypeScript 93.2% | JavaScript 6.8%
🌐
auto
intuit.github.io › auto › docs › generated › gh-pages
GitHub Pages Plugin - Intuit
{ "plugins": [ [ "gh-pages", { "buildCommand": "npm run build:docs", "dir": "./path/to/built/docs/website" } ] // other plugins ] } { "plugins": [ [ "gh-pages", { "buildCommand": "npm run build:docs", "dir": "./path/to/built/docs/website" } ] // other plugins ] }
🌐
Gridsome
gridsome.org › docs › deploy-to-github
Deploy to GitHub Pages - Gridsome
If you are deploying to your GitHub user page (your main site on <username>.github.io) ... Now when you run the npm run deploy command, your project will be built and the contents of the dist folder will be pushed to the gh-pages branch which is where your "GitHub user page" will deploy from.
🌐
CommandMasters
commandmasters.com › commands › git-gh-pages-common
How to Use the Command 'git gh-pages' (with examples)
The git gh-pages command is a powerful yet straightforward tool for developers who aim to leverage GitHub Pages for hosting static sites directly from their Git repository. It encapsulates a standard yet multi-step process into a single command ...
🌐
Ull-esit-dsi-1617
ull-esit-dsi-1617.github.io › tareas-iniciales-alberto-diego › Alberto › ghpages › ghpages.html
Gh-pages · Tareas iniciales
Básicamente tras la ejecución de este script se realizará un despliegue de gh-pages en el repositorio que le indiquemos a la funcion publish(), si dicha rama gh-pages no existe, la creará de forma automática. ... Paso 1: Iniciamos el proyecto creando el fichero package.json que describirá y mantendrá nuestra aplicación: ... Paso 3: Creamos un fichero js, por ejemplo deploy.js, en el que introduciremos el código que incluirá llamadas al módulo de gh-pages para hacer la subida a github de forma automática:
🌐
GitHub
github.com › cli › cli › issues › 4018
Add gh prompt to set up gh pages · Issue #4018 · cli/cli
July 20, 2021 - It'll make it possible to set up a gh pages for your repo via the CLI.
Author   AviFS
🌐
Pluralsight
pluralsight.com › tech insights & how-to guides › tech guides & tutorials
Deploying Github Pages with create-react-app | Pluralsight
March 5, 2020 - This will create a new folder named guide-react-gh-pages (or whatever you named your app).
🌐
Sean Coughlin
blog.seancoughlin.me › deploying-to-github-pages-using-gh-pages
Deploying to GitHub Pages using gh-pages
October 7, 2023 - It automates the process of pushing your static assets to the gh-pages branch of your GitHub repository, which is then automatically published by GitHub Pages. This package is often used in combination with site generators or build tools to ...