Problem setting Git user and email for submodule

I have a submodule within a Node app, and at certain points the Node app makes a commit and push to the submodule’s repo.

I’m using the simple-git NPM to run the git commands, but these are failing with errors due to missing user name and email:

fatal: unable to auto-detect email address (got ‘render@srv-cnriougl5elc73b246o0-hibernate-f49fc58b7-pfhvd.(none)’)

I’ve tried:

  • setting the user details explicitly in the .gitconfig in the submodule
  • setting the user details explicitly in the .gitconfig in the main project
  • setting the user details explicitly in the main project with a script during deploy
  • setting the user details explicitly in the simple-git config within the project

Is there somewhere else that this setting can be configured?

Hi there,

I think my approach would be to create a new directory with .gitconfig for your user, then clone a copy of your sub-modules repo into that directory and use that to push changes.

Give that a try and let me know how it goes.

Regards,

Matt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.