Forum Discussion
Multi GitHub Accounts Use. Implement a command.
Hello, I had a problem and I am going to post it here to help anyone that has the same problem. I have 2 accounts of GitHub and I have the problem to use both of the accounts when I need and use 1password to have the private keys. I use this config for this git agent.toml
[[ssh-keys]]
and use a ~/.ssh/config file : ```
vault = "Personal"
Acc 2
Host
HostName github.com
User git
IdentityFile ~/.ssh/
IdentitiesOnly yes
Acc 2
Host
HostName github.com
User git
IdentityFile ~/.ssh/
IdentitiesOnly yes
```
When you want to use a account or other (with the "ssh key") you have to use the regular github repo remote add . Then you have to replace the mailto:git@github.com with the . Then I created this .bat script ```@echo off
echo Configurando Git...
git config --global user.name "x"
git config --global user.email "x"
git config --global user.signingkey "x"
echo Configuración completada.
pause
```
I have created a folber with a sys path and then i put the file in the sys path folder and only had to put the name of the file in the terminal and it is configured for your multiaccount git setup.
1Password Version: 1Password for Windows 8.10.36 (81036046)
Extension Version: 2.25.1
OS Version: Windows 11 Pro 23H2
Browser: Brave v1.67.134