gh-pages icon indicating copy to clipboard operation
gh-pages copied to clipboard

Cannot Deploy without git config --global setting.

Open 54yd opened this issue 7 years ago • 3 comments

I saw this bug when I deploy it with my git environment below.

fatal: no email was given and auto-detection is disabled

my environment is here.

  1. git config global set "user.useconfigonly=true", and no "user.name" / "user.email" keys and values.
  2. git config local set "user.name" / "user.email" keys and values.
  • [NOTE]
    • I always do switch my github account along a target repo, so never setting name/email on global. This setting is not usual for many people, so many user will not see this bug, I think.

    • Then, I use git config global, write user/email, this error resolved.

I think, maybe, something your implemantation around "git push", has a little bug. Please check and fix it.

Sincerely, StrayDrop

terminal screenshot is here. 2018-03-31 23 16 28

54yd avatar Mar 31 '18 14:03 54yd

Yep, I got the same problem. Then I thought why do I even need a library for this:

  • Install rimraf: yarn add -D rimraf
  • Add this to scripts: "deploy": "npm run build && rimraf static && mv build/** ."

Then use this to deploy:

  1. Checkout to gh-pages -branch: git checkout gh-pages (add -b if the branch doesn't exist)
  2. Run: npm run deploy
  3. Add files: git add -A
  4. Create commit: git commit -m "Version 0.1.0"
  5. Maybe tag it: git tag v.0.1.0
  6. Push it to Github: git push origin gh-pages --tags

Now the project should be available at http://USERNAME.github.io/REPOSITORY

TeemuKoivisto avatar May 28 '18 10:05 TeemuKoivisto

I'm experiencing a very similar issue when my local user.email differs from my global user.email.

For some reason, the user section is missing from the config file under node_modules/gh-pages/.cache/*/.git even though it is present in my project's .git/config file.

mhenry07 avatar Aug 27 '18 07:08 mhenry07

I'm getting a similar thing. When I publish, I seem to get one commit that respects the local .gitconfig, then one that reverts to the global git config.

nuklearfiziks avatar Aug 29 '18 01:08 nuklearfiziks