Official document: https://www.jetbrains.com/help/idea/settings-tools-settings-repository.html
With Personal Access Token (PAT), as far as I tried, it is impossible to push changes to private repos. Therefore it is impossible to use https:// git url as sync rpeo.
With [email protected] URL, jgit (jsch) emits authorization errors on sync even if the SSH pub key is added to your Github account. This is because jgsch does not support OpenSSH format ssh private keys.
Create RSA format PEM key file.
cp id_rsa id_rsa.pem
# This command OVERWRITES the specified file. Copy the key beforehand.
ssh-keygen -p -f id_rsa.pem -m pem
Add dummy host to ~/.ssh/config to use the above PEM key for access from jsch.
Host github-jgit
Hostname github.com
User git
IdentityFile C:\Users\YOU\.ssh\id_rsa.pem
Specify the proxy hostname when setting repo to IDEA.
[email protected]:YOU/idea-setting-sync.git
↓
git@github-jgit:YOU/idea-setting-sync.git
For this method, PAT is not required at all.