Multiple git account in the same computer (Windows)

Set gitconfig

Global config: default path C:\Users\Elmo\.gitconfig

[User]
    name = elmo_aaa
    email = elmo@aaa.com

[includeIf "gitdir/i:D:/Note/"]
    path = D:/Note/.git/config

Specific project config: D:/Note/.git/config

[User]
    name = elmo_bbb
    email = elmo@bbb.com

Generate SSH Key for specific account

ssh-keygen -t rsa -C "elmo@bbb.com"

the default path is C:\Users\Elmo\.ssh

it can't use the default name in the default path because it will replace the original account SSH key

finally, copy the content of public key and paste in GitLab SSH keys

 
arrow
arrow
    文章標籤
    Git
    全站熱搜
    創作者介紹
    創作者 Elmo 的頭像
    Elmo

    ElMO

    Elmo 發表在 痞客邦 留言(0) 人氣()