vscode-pull-request-github icon indicating copy to clipboard operation
vscode-pull-request-github copied to clipboard

ssh ignores current users .ssh folder

Open theking2 opened this issue 5 years ago • 9 comments

To keep track of multiple accounts a custom ssh configuration is uesd with sample

Host github.com
	HostName github.com
	User git
	IdentityFile ~/.ssh/id_ed25519_normal

Host github-special.com
	HostName github.com
	User git
	IdentityFile ~/.ssh/id_ed25519_special

pull-request-github complaints about connection [email protected];user/repo.git

theking2 avatar Nov 11 '21 14:11 theking2

Can you give an example of the complaint?

alexr00 avatar Nov 12 '21 10:11 alexr00

Login not possible

theking2 avatar Nov 14 '21 20:11 theking2

I don't see the error "Login not possible" anywhere in this extension code base or microsoft/vscode. Can you share a screenshot?

alexr00 avatar Nov 15 '21 12:11 alexr00

the complete text: Fetching pull requests for remote 'origin' failed, please check if the url [email protected]:theking2/dwh_php7.git is valid.

Integrated source control has no problem.

git remote --verbose
proj1        https://github.com/theking2/proj1.git (fetch)
proj1        https://github.com/theking2/proj1.git (push)
origin  [email protected]:theking2/proj1.git (fetch)
origin  [email protected]:theking2/proj1.git (push)

theking2 avatar Nov 19 '21 08:11 theking2

config in (-join($Env:USERPROFILE)) /.ssh:

 #theking2 account [email protected]:theking2/repo-name
Host github-special.com
        HostName github.com
        User git
        IdentityFile ~/.ssh/id_ed25519

theking2 avatar Nov 19 '21 08:11 theking2

I'm not sure this is the exact same issue, but may be in a similar vein...

I have multiple GitHub accounts I use (Personal & Work). When logged in to the extension with my personal GH account and try to access a work repo I get the error: Fetching pull requests for remote 'origin' failed, please check if the url git@my-org/work-repo.git is valid.

Is there a way to login to GitHub PR Extension with more than one GitHub account? Or configure it to accept different credentials for different repos?

derekwilling avatar Nov 30 '21 16:11 derekwilling

@DirtySoc it is possible to work with mulitple github accounts exactly in the way I described. If I clone from my 'normal' account I use: git clone [email protected]:user1/proj1.git

if I clone from my special account I use: [email protected]:user2/proj2.git

This works in Source Controlin vscode as:

git remote --verbose
origin  [email protected]:user2/proj2.git (fetch)
origin  [email protected]:user2/proj2.git (push)

Unfortunately Pull Requests ignores the settins in .ssh/config and always uses a fixed github.com ([email protected]:user2/proj2.git).

theking2 avatar Dec 16 '21 14:12 theking2

I also have the same issue, I use multiple accounts one personal and another one for work, I clone using my personal. account by adding -personal to [email protected]:xxxx/xxxx.git and it becomes [email protected]:xxxx/xxxx.git.

apparently the extension doesn't support that and as a result I get the same error message

Fetching pull requests for remote 'origin' failed, please check if the url [email protected]:xxxx/xxxxx.git is valid.

please have a look at this.

ghost avatar Dec 23 '21 18:12 ghost

Should be a duplicate of https://github.com/microsoft/vscode-pull-request-github/issues/3329 and the problem fixed by https://github.com/microsoft/vscode-pull-request-github/pull/3946.

If you're interested in trying out the fixes, please use the pre-release build (starting with the one that will be released tomorrow) and the latest VS Code Insiders. There is also PAT-less auth there.

alexr00 avatar Sep 21 '22 14:09 alexr00