user1316498
user1316498

Reputation:

Jenkins/Github: Apparently .git/config doesn't exist?

So after installing the Github plugin to Jenkins CI and attempting to add a job for my Github project to compile automatically after a Github push to master, Jenkins reports that .git/config doesn't exist.

I went to /var/lib/jenkins and created .git and the config file and chowned them to jenkins:nogroup.

The error persisted. I then went and did this in my own VPS home directory. Error persists.

I then made a home folder for the jenkins user with no shell and did the same steps. Error persists.

Which .git/config is it referring to?!

Edit:

The actual error I'm referring to is:

Failed to connect to repository : Command "git config --local credential.helper store --file=\"/tmp/git7406572387997126825.credentials\"" returned status code 255:
stdout: 
stderr: error: could not lock config file .git/config: No such file or directory

Upvotes: 1

Views: 6038

Answers (2)

sneakysheila
sneakysheila

Reputation: 32

Found a neat workaround here: https://groups.google.com/forum/#!topic/git-users/pyv6ldFxUio

  1. mkdir ~/.git
  2. git config --global user.email "[email protected]"

https://groups.google.com/forum/#!topic/git-users/pyv6ldFxUio

Upvotes: 1

user1316498
user1316498

Reputation:

Solved...switched to SSH.

Steps:

Assume control of Jenkins user. su jenkins (You may need to set a password for it first (make it good!) sudo passwd jenkins.

Go home: cd ~.

Generate key: ssh keygen -t rsa -C "email". (No passcode)

Copy $JENKINS_HOME/.ssh/id_rsa.pub to Github.

Set Jenkins credentials to authenticate to Github using the private key.

Works fine.

Upvotes: 2

Related Questions