Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the
gh-pages
command runs, it creates a repo in a cache directory. By default, this directory is in thegh-pages
install directory (e.g.path/to/node_modules/gh-pages/.cache
).Previously, commits that were created in the cached repo used the
git config user.email
andgit config user.name
as determined from the cached repo. In the case of a globalgh-pages
install, this user name and email would most likely be the global git user. In the case of a localgh-pages
install, this would be a local git user if one was configured.This branch changes things so that the user is determined by running
git config user.email
(and same for name) in the current working directory. This means that the git user will be the local user if the current directory is a git repo and has a locally configured user. Otherwise it will be the global git user.To override the behavior of determining the git user, a
user
option can be provided. For the CLI, the format of this option is "Full Name <[email protected]" (see RFC-5322). For example:The same behavior applies to programmatic usage. A
{name, email}
object can be provided for theuser
option. If not provided,git config user.email
will be run in the current working directory.Thanks to @holloway for initiating this in #229. And to @nuklearfiziks for resurrecting it once and @paulirish for resurrecting it a second time in #261.