0

In Windows env, I need to create multi-user git account for GitLab(company) and GitHub(personal), I configured the config file under .ssh folder, but I have to execute following two command every time manually when I wanna use company account.

ssh-agent bash
ssh-add ~/.ssh/id_rsa_company

is there any way to add the id_rsa_company to SSH session permanently. I searched that ssh default id_rsa file.

1 Answers1

0

Are you using any sort of BASH emulation in Windows? Are you using Cygwin?

  1. If you can use real BASH (which has been recently introduced into Windows), you can add such command to your ~/.bashrc file (where ~ is a shorthand for your home directory).

  2. Alternatively you can add the keys to the identity file, in the solution described here.

Hope this helps.

Community
  • 1
  • 1
  • I use Git Bash, and following is my config file content: [link](http://7xkyc7.com1.z0.glb.clouddn.com/stackOverFlow_1.png), – Fraser Yu Aug 10 '16 at 02:31
  • I know after configuring the config, I can clone by typing git clone git@host:username/project.git, how to pull/push specify branch by using git@hostXXXXXXX – Fraser Yu Aug 10 '16 at 02:43