References
-
How To Work With Multiple Github Accounts on your PC
-
SSH and GPG keys - GitHub
-
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs
-
command line - ssh-add complains: Could not open a connection to your authentication agent - Unix & Linux Stack Exchange
-
ssh-add does not need
-K
anymore -
Starting ssh-agent on Windows 10 fails: "unable to start ssh-agent service, error :1058" - Stack Overflow
Example:
git clone git@github.com-hansimov:Hansimov/turtle-trader.git
git clone git@gist.github.com-hansimov:a68809441cbd16290bdf98a9b5004fdb.git
<repo-local-path>\.git\config
:
[core]
...
[remote "origin"]
url = git@github.com-hansimov:Hansimov/turtle-trader.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[user]
name = Hansimov
email = <email-address>
C:\Users\xxx\.ssh\config
:
Host github.com
Hostname ssh.github.com
Port 443
ProxyCommand connect -H <proxy-server>:<port> %h %p
IdentityFile ~/.ssh/id_rsa_work
Host github.com-hansimov
Hostname ssh.github.com
Port 443
ProxyCommand connect -H <proxy-server>:<port> %h %p
IdentityFile ~/.ssh/id_rsa_hansimov
Host gist.github.com-hansimov
Hostname ssh.github.com
Port 443
ProxyCommand connect -H <proxy-server>:<port> %h %p
IdentityFile ~/.ssh/id_rsa_hansimov
If already commit with wrong authors, run:
For example, if you use wrong account to add two commits, then
BASE_SHA
should beHEAD~2
.References: