- I am using the functionality that automatically merge branch from Jenkins (Git Plugin and/or Validate Merge Plugin)
- When doing the merge/push my build fail a stacktrace similar to:
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git merge qwertyuiopasdfghjklzxcvbnm" returned status code 128: stdout: stderr: *** Please tell me who you are. Run git config --global user.email "email@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 <jenkins@localhost> not allowed
When doing a push, git needs user information to be able to push anything. This can be configured in Jenkins either Globally or per Project.
In the global configuration under Manage Jenkins > Configure System > Git Plugin:
In the project configuration, under Source Code Management > Git > Additional Behaviours, you can add the behaviour Custom user name/email address:
When using validate merge, you can specify which user/credentials to use for logging to the remote host. For example, you can use*Username/Password credentials and specify your GitHub API Token as password:
For more information, please have a look at Validate Merge Plugin - Pushing to the upstream repository