Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ The default options work for simple cases. The options described below let you
#### <a id="optionssrc">options.src</a>
* type: `string|Array<string>`
* default: `'**/*'`
* `-s | --src <src>`

The [minimatch](https://github.com/isaacs/minimatch) pattern or array of patterns is used to select which files should be published.

Expand Down Expand Up @@ -97,6 +98,7 @@ ghpages.publish('dist', {
#### <a id="optionsdest">options.dest</a>
* type: `string`
* default: `'.'`
* `-e | --dest <dest>`

The destination folder within the destination branch. By default, all files are published to the root of the repository.

Expand All @@ -115,6 +117,7 @@ ghpages.publish('dist', {
#### <a id="optionsdotfiles">options.dotfiles</a>
* type: `boolean`
* default: `false`
* `-t | --dotfiles`

Include dotfiles. By default, files starting with `.` are ignored unless they are explicitly provided in the `src` array. If you want to also include dotfiles that otherwise match your `src` patterns, set `dotfiles: true` in your options.

Expand All @@ -131,6 +134,7 @@ ghpages.publish('dist', {dotfiles: true}, callback);
#### <a id="optionsnojekyll">options.nojekyll</a>
* type: `boolean`
* default: `false`
* `--nojekyll`

Write out a `.nojekyll` file to [bypass Jekyll on GitHub Pages](https://github.blog/2009-12-29-bypassing-jekyll-on-github-pages/).

Expand All @@ -145,6 +149,7 @@ ghpages.publish('dist', {nojekyll: true}, callback);

#### <a id="optionscname">options.cname</a>
* type: `string`
* `--cname <CNAME>`

Write out a `CNAME` file with a custom domain name.

Expand All @@ -161,6 +166,7 @@ ghpages.publish('dist', {cname: 'custom-domain.com'}, callback);
#### <a id="optionsadd">options.add</a>
* type: `boolean`
* default: `false`
* `-a | --add`

Only add, and never remove existing files. By default, existing files in the target branch are removed before adding the ones from your `src` config. If you want the task to add new `src` files but leave existing ones untouched, set `add: true` in your options.

Expand Down Expand Up @@ -201,6 +207,7 @@ ghpages.publish('dist', {
#### <a id="optionsremote">options.remote</a>
* type: `string`
* default: `'origin'`
* `-o | --remote <name>`

The name of the remote you'll be pushing to. The default is your `'origin'` remote, but this can be configured to push to any remote.

Expand All @@ -219,13 +226,15 @@ ghpages.publish('dist', {
#### <a id="optionstag">options.tag</a>
* type: `string`
* default: `''`
* `-g | --tag <tag>`

Create a tag after committing changes on the target branch. By default, no tag is created. To create a tag, provide the tag name as the option value.


#### <a id="optionsmessage">options.message</a>
* type: `string`
* default: `'Updates'`
* `-m | --message <message>`

The commit message for all commits.

Expand All @@ -244,6 +253,7 @@ ghpages.publish('dist', {
#### <a id="optionsuser">options.user</a>
* type: `Object`
* default: `null`
* `-u | --user <address>`

If you are running the `gh-pages` task in a repository without a `user.name` or `user.email` git config properties (or on a machine without these global config properties), you must provide user info before git allows you to commit. The `options.user` object accepts `name` and `email` string values to identify the committer.

Expand All @@ -261,6 +271,7 @@ ghpages.publish('dist', {
#### <a id="optionsremove">options.remove</a>
* type: `string`
* default: `'**/*'`
* `-v | --remove <pattern>`

Removes files that match the given pattern (Ignored if used together with
`--add`). By default, `gh-pages` removes everything inside the target branch
Expand All @@ -278,6 +289,7 @@ ghpages.publish('dist', {
#### <a id="optionspush">options.push</a>
* type: `boolean`
* default: `true`
* `-n | --no-push`

Push branch to remote. To commit only (with no push) set to `false`.

Expand All @@ -291,6 +303,7 @@ ghpages.publish('dist', {push: false}, callback);
#### <a id="optionshistory">options.history</a>
* type: `boolean`
* default: `true`
* `-f | --no-history`

Push force new commit without parent history.

Expand All @@ -304,6 +317,7 @@ ghpages.publish('dist', {history: false}, callback);
#### <a id="optionssilent">options.silent</a>
* type: `boolean`
* default: `false`
* `-x | --silent`

Avoid showing repository URLs or other information in errors.

Expand Down Expand Up @@ -352,6 +366,7 @@ ghpages.publish('dist', {
#### <a id="optionsgit">options.git</a>
* type: `string`
* default: `'git'`
* `--git <git>`

Your `git` executable.

Expand All @@ -366,6 +381,25 @@ ghpages.publish('dist', {
}, callback);
```


#### <a id="optionsdepth">options.depth</a>
* type: `number`
* default: `1`
* `-p | --depth <depth>`

Depth for the git clone operation when creating a temporary clone. By default, a shallow clone with depth of 1 is used to minimize the amount of data transferred.

Example use of the `depth` option:

```js
/**
* Create a shallow clone with a depth of 5 commits.
*/
ghpages.publish('dist', {
depth: 5
}, callback);
```

## Command Line Utility

Installing the package creates a `gh-pages` command line utility. Run `gh-pages --help` to see a list of supported options.
Expand Down