Skip to content
Configuration

Configuration

Secrets

You can provide credentials through command-line options:

  • --password for the site password;
  • --token for a Forge access token.

For environments where command-line arguments may be exposed, use the supported alternatives:

  • --password-file or the GIT_PAGES_PASSWORD environment variable;
  • the GIT_PAGES_TOKEN environment variable.

When both an environment variable and its corresponding command-line option are provided, the command-line option takes precedence.

For example:

$ export GIT_PAGES_TOKEN='your-token'
$ git-pages-cli https://username.gitnet.fr --upload-dir site-contents

Do not commit passwords or access tokens to your repository.

Pretty URLs

When using --upload-dir, the --pretty-urls option creates redirects so that HTML files can be accessed without their .html extension.

For example, /about.html can also be accessed as /about or /about/:

$ git-pages-cli https://www.example.org \
    --password xyz \
    --upload-dir site-contents \
    --pretty-urls

The CLI discovers *.html files and generates the corresponding _redirects entries. If the source directory already contains a _redirects file, generated rules are appended to it, leaving user-defined rules first.

Add deployment metadata

Use --comment to add a free-form comment to the site manifest. A useful example is the Git commit used to build the website:

$ git-pages-cli https://www.example.org \
    --password xyz \
    --upload-dir site-contents \
    --comment "$(git rev-parse HEAD)"