I have used VS 2019 and 2022 with Github for quite a while but it is all limited to regular https with email/password login.
I have this project where is git over ssh is required. I dont want to install separate git client if possible.
Can I configure SSH auth to Github from VS 2022?
Visual Studio 2022 supports SSH-authenticated Git clients.
SSH authentication in Visual Studio 2022 with GitHub requires these steps:
SSH clients produce public-private key pairs. Git Bash or another command-line tool can generate the key pair.
GitHub: Add your public key. After generating your SSH key pair, add your public key to GitHub. Click "SSH and GPG keys" in your GitHub account settings. Click "Create SSH key" and paste your public key.
SSH-enable Visual Studio 2022: Open "Team Explorer" in Visual Studio 2022. Click "Settings" and then "Git" at the bottom of the pane. Click "Edit" next to "Git Config" in "Global Settings". Add these lines to GitConfig:
sshCommand=C:/Windows/System32/OpenSSH/ssh.exe
Update the path if you installed OpenSSH elsewhere.
After configuring Visual Studio 2022 for SSH, utilize the "Clone" button in the "Team Explorer" tab to clone your repository. Enter the SSH URL for your repository (e.g. git@github.com:username/repository.git) in the "Clone" window and click "Clone".
Visual Studio 2022 can be an SSH-authenticated Git client after cloning your repository.