© 2003–2025 The Redmond Family. All rights reserved.
HomeCraigEthanJoshuaKylaAmy
 

Setting up personal git keys

(Replace with your name and email)

 
  1. Run this:
     cd ~/.ssh/; ssh-keygen -t rsa -b 4096 -C "[email protected]" -f "id_rsa_personal"
 
  1. Copy ~/.ssh/id_rsa_personal.pub into your Gitlab keys.
  2. Ubuntu: Set SSH keys perms: chmod 0600 ~/.ssh/id_rsa*
  3. Windows only: eval $(ssh-agent)
  4. Run these:
     ssh-add ~/.ssh/id_rsa_personal
     touch ~/.ssh/config
     gedit ~/.ssh/config
  5. Paste this into the config file:
     # Work account - default
     Host gitlab.com
        HostName gitlab.com
        User git
        IdentityFile ~/.ssh/id_rsa
    
     # Personal account
     Host gitlab.com-personal
        HostName gitlab.com
        User git
        IdentityFile ~/.ssh/id_rsa_personal
 
  1. Check the git remote with this: git remote -v
  2. Update with git remote set-url origin [email protected]:ethanredmond/[REPO_NAME].git if necessary.
  3. Also run these to change commit names:
     git config user.name "Ethan Redmond"
     git config user.email [email protected]
 
git clone [email protected]:ethanredmond/[REPO_NAME].git

Source

© 2003–2025 The Redmond Family. All rights reserved.
www.redmondfamily.com/Ethan/Notes/Setting_up_personal_git_keys