statamic / spock

Automatically perform git commits, pushes, and other cli actions when Statamic content changes
95 stars 16 forks source link

Spock asking for Git Config Credentials even though Set Already in .gitconfig #11

Closed bgarrant closed 6 years ago

bgarrant commented 6 years ago

Upon install, when tested Spock gives this error in logs:

[2018-04-26 06:45:55] production.ERROR: Spock command exited unsuccessfully: 
git add --all; git commit -m '/aging-friendly-communities/growing-need updated by bgarrant'

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <user@server.com>) not allowed

I already have a .gitconfig in the root with these settings:

[user]
    email = info@garrant.com
    name = Bryan Garrant

So where is it saving these new credentials? It is not in the root so must be elsewhere? I have Statamic installed above my webroot so maybe that is why? Regardless if I run those commands without the --global tag it fixes the issue:

Run

  git config user.email "you@example.com"
  git config user.name "Your Name"
jackmcdade commented 6 years ago

Is the repo cloned with https: or git:? You can do git remote -v to check.

bgarrant commented 6 years ago

git push from local to production on this one. Not clone function. the command you suggested said

origin  ssh://perufcu/home/perufcu (fetch)
origin  ssh://perufcu/home/perufcu (push)
bgarrant commented 6 years ago

There was already a .gitconfig file created in the root before Spock was installed

jackmcdade commented 6 years ago

There's a global git config you can set those in that'll be respected across your whole system. This isn't a Spock thing, just a git thing.

https://help.github.com/articles/setting-your-username-in-git/