I've tried cloning a private repo (that I have access to) on GitHub and get this message:
Clone Failed
Could not connect to 'origin'. Double-check your remote url, then make sure you have access to do that action on that remote and try again.
I run Windows 10, I have connected Kraken to GitHub and ssh key works and I can push and pull repos to my other GitHub repos that are public just fine.
I was also able to clone the repo from the command line just fine.
For some reason, GitKraken does not use your existing HTTPS credentials to communicate with GitHub, nor does it use SSH on Windows. Instead it uses OAuth2, which means you need to grant OAuth2 access to GitKraken.
https://support.gitkraken.com/integrations/github
If no remotes or repositories are appearing in Add Remote or Clone, the likely cause is the need for an organization to allow access. GitKraken cannot see those repos when cloning or adding a fork unless the org specifically gives permission to GitKraken as an application.
First check to see if access is allowed to GitKraken from GitHub Applications
If access has been allowed, then the organization will need to allow Organization Approval
For details about third-party application restrictions view Third-party apps list
These are the steps I took and they worked for me:
You need to be an administrator in your GitHub Organization.
Access the GitHub GitKraken Application page and request access:
https://github.com/settings/connections/applications/a7557949433b7d282a76
You will see a list of your Organizations at the bottom. Click "Request access" if applicable.
If your Organization is not listed then you have other problems (are you using the correct GitHub user account? Are you a member of the Organization?)
This is what the page looks like for me:
Approve of the Access you just requested:
Access this page: https://github.com/organizations/YOUR_ORG_NAME/settings/oauth_application_policy
You can also access the page by going GitHub Settings > "Organization settings" > "Third-party access"
This page looks like this:
This is not the same page as your "Personal settings" > "Authorized applications" page ( https://github.com/settings/applications )
You should see GitKraken listed as requesting permission.
Click the Approve link to grant it access.
GitKraken should work now.
However, in my experience I don't reliably see the GitKraken request listed in the Requests list. I've contacted GitKraken Support for assistance.
You can use the "GitHub Enterprise" configuration instead of the "GitHub.com" configuration:
As the domain for your GitHub enterprise server just enter "GitHub.com".
Generate a personal access token.
This will work with all repos you have access to, even if the organization has not opted-in to allowing OAuth 2 apps to access them, and it works regardless of which version of GitKraken you're using (i.e. you don't need "Pro").
I had the same issue. I solved by disconnecting from my GitHub.com account in GitKraken. Then, when I tried to clone an organizational private repo, GitKraken asked me username and password. The repo was cloned successufuly.
The above answers are all correct, and granting access to your Github organization is still the recommended way to go if you want to take full advantage of GitKraken's features, but if your organization admins can't or won't grant access, Gitkraken supports SSH keys as well.
It'll only use them on existing repos if the URL of the remote is an SSH url (starts with ssh:), and it'll only clone over SSH if you allow it to generate its own SSH key. Go to Preferences > authentication > Github, and it should be able to clone any repo you have access to.
Related
My question is the same as Github add SSH key from others will grant access to all repos?, except my use case is that I am working on a shared server with other contributors. We all need access to a certain repository on this server. However, since GitHub requires SSH now, how can I clone and use the repository without adding my SSH key to the server and allowing everyone else access to all of my personal repositories?
I have already added my teammates as contributors in the repo we want to clone; it would be nice if we could each individually use our username and passwords to interface with the repo (like the old HTTPS method of cloning git repositories) without having to share our private keys with each other. If there is an option to only allow SSH access to a specific repo, that would be nice as well.
The only workaround I can think of right now is to create a dummy GitHub account with the sole purpose of accessing this repo, and registering our SSH key with that GitHub account. But this seems very contrived and I'm wondering if there is a better solution to this problem.
A dummy github account with only the right permissions to access the one repo is what GitHub calls a Machine Account and is the recommended way to provide access under scenarios like these.
Alternatively, you could use a deploy token, those are bound to a single repo by default.
I am trying to clone a repository. It needs SSO to view it. I use a Personal Access Token(with repo permission) for push, pull, etc.
Now I am trying to use GitHub Desktop, but it says authentication failed when I'm trying to clone the repository. Entering the correct credentials is throwing the same error.
How can I clone this repository and use it in GitHub Desktop?
PS: Other repositories(that don't need SSO) are cloning fine.
You need to go to Preferences -> accounts and sign in there. What helped in my case was to sign out and sign in again using the option to sign in with browser.
Also this documentation was helpful : https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/installing-and-authenticating-to-github-desktop/authenticating-to-github
I have on my Mac two GitHub users, one is for work and another is personal. I set them up following this tutorial:
https://medium.com/#ibrahimlawal/developing-with-multiple-github-accounts-on-one-macbook-94ff6d4ab9ca
I created a repo with my personal account, and tried to do a push with the work account, and to my surprise, it let me do this. I thought it should stop me from doing it because the work user should not have access to the personal GitHub. How can I avoid it? I want to be able to push to a personal repo with only my personal account, and to my work repos only with my work account.
The article is about managing two different SSH keys.
But if you can push, it might be because:
you are using an HTTPS URL
your work account credentials were cached (git config credential.helper: probably credential-osxkeychain on Mac: see "clear all Git credentials").
i'm trying to configure teamcity with my github.
the first step was to use OAuth in git in order to secure the connection between teamcity and git, that seemed to work ok, and now, when i go to add a new VCS root, i can see all of my git repositories and choose from them.
the issue i have is when i try to add this VCS root, i choose a git repository, and then i need to enter a username and password.
my question here is why do i need to enter my git username and password if i'm using Oauth? my connection to git is already secured, and i could see all of the repositories to choose from.
if i change the "Authentication method" to "Anonymous" it doesnt work, the only way the connection is working for me is if i use my git username, and my git token.
When you connect TeamCity to GitHub with help of OAuth, you grant TeamCity server permissions to make REST API calls to GitHub on your behalf. But to checkout source code this is not enough. Simply because your git executable knows nothing about OAuth tokens and all these OAuth specific flows. It expects a password or SSH key.
So for this to work TeamCity needs to generate something that can be used as a password. Fortunately in case of GitHub a regular OAuth token can be used as such because it's permanent. Bitbucket cloud does not have permanent tokens, instead they propose using Application passwords. But there is no way to generate such passwords on behalf of a user... So with Bitbucket and private repository only user can generate and type in this password.
There can be a confusion associated with "Password" word in TeamCity web interface. But there is no common notation even among popular Git hosting services. Maybe if you start thinking in terms of Git client, then it will makes sense. For Git client this is indeed a password.
So I just started off with github, I created two accounts to practice with. One as myself and another as a different user to test pushing files. This is a public repository.
So I'm able to push files with my account.
However when I use my 2ndary account and clone my repo and then try to push as a different user I get error 403. I'm using https.
I just installed the lastest git from git-scm.
In GitHub if you go to the repository settings and under the Collaborators section you should be able to add that second user. Reading that section it says that it allows push access to the repository.
HTTP 403 is "permission denied"; this clearly indicates you're either not authenticating with the right credentials, or the second user doesn't have push rights to that repo (which is the case unless you explicitely give the second user push rights).