Reputation: 6301
I am new to using TeamCity. I am trying to figure out how to build code from my private GitHub repository. In an attempt to do this, I did the following.
Created the Deployment Key
Added the Deployment Key to GitHub
Created my Project in TeamCity
When I click "Test connection", I receive an error. The error is:
Test connection failed in <ProjectName> :: <BuildName>
Incorrect url git://[email protected]/<username>/<repo-name>.git: anonymous git url should not contain a username
If I remove the "Username" field, I get the same error. If I change the Fetch URL to be the url listed in GitHub (https://github.com//.git), I get an error that says:
Test connection failed in <ProjectName> :: <BuildName>
List remote refs failed: org.eclipse.jgit.errors.TransportException: https://github.com/<username>/<repo-name>.git: not authorized
What am I doing wrong?
Upvotes: 2
Views: 880
Reputation: 24040
You need to ensure the public key is uploaded to GitHub and then use the private key in your TeamCity instance. In addition, the SSH key is only use when using the ssh:
protocol to GitHub, not the https:
protocol.
Upvotes: 3