Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to authenticate with private Github repo - fails build every time #103

Closed
dynajoe opened this issue Dec 26, 2014 · 7 comments
Closed

Comments

@dynajoe
Copy link

dynajoe commented Dec 26, 2014

The Github client is prompting for username when trying to clone private repo. It fails with:

[bunch of stuff show in image below]
Cloning into '/var/myorg/myrepo'...
fatal: could not read Username for 'https://github.com': No such device or address

I have provided client access key and authorized the application to have access to private repos through OAuth.

Jenkins ver. 1.595

May be related to #102

image

@dynajoe
Copy link
Author

dynajoe commented Dec 27, 2014

I got this to work by creating a docker image that had a credential stored on the disk at ~/.git-credential. I also set git config --global credential.helper store. The format for the .git-credentials file should look like this:

https://<TOKEN>:x-oauth-basic@github.com

Replace with an Github OAuth Token. See https://help.github.com/articles/git-automation-with-oauth-tokens/

This could also be fixed if the git clone command contained the token:password like this:

git clone https://<TOKEN>:x-oauth-basic@github.com/org/repo

However, it would require a code change to make this happen by default. You COULD change the Github project url to include the credentials for each project but that's cumbersome.

@dynajoe dynajoe changed the title Unable to authenticate with Github repo - fails build every time Unable to authenticate with private Github repo - fails build every time Dec 27, 2014
@dinoshauer
Copy link

Following this, as I would like to use dotCI with our private repos 👍

@dinoshauer
Copy link

Just a correction to @joeandaverde 's temporary solution with a .git-credential file it should be named .git-credentials 👍 for that!

@justicel
Copy link

@suryagaddipati I'm stuck on solving for this issue. Just wanted to +1 this as an issue for myself as well.

@pcorliss
Copy link

pcorliss commented Mar 5, 2015

Same issue here.

@vineetbaldwa
Copy link

Same issue here with trying to load a private repo as a git submodule.

@suryagaddipati
Copy link
Contributor

Private repos now work in 2.7.1 using Docker compose build type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants