Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Multiple GitHub Accounts

Based on 8 Easy Steps to Set Up Multiple GitHub Accounts.

The plan is:

Common Config

My business laptop ~/.gitconfig:

# ~/.gitconfig

[includeIf "gitdir:~/PersonalProjects/"]
path = ~/PersonalProjects/.gitconfig

[includeIf "gitdir:~/Projects/"]
path = ~/Projects/.gitconfig

[core]
excludesfile = ~/.gitignore      # valid everywhere

[core]
        pager =
        excludesfile = /Users/asokolsky/.gitignore_global
        editor = /opt/homebrew/bin/emacs

[alias]
        co = checkout

[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        process = git-lfs filter-process
        required = true

[init]
        defaultBranch = main

[push]
        autoSetupRemote = true
        default = current

[pull]
        rebase = true

[rebase]
        autoSquash = true
        autoStash = true

Business Config

My business projects are in ~/Projects/, my ~/Projects/.gitconfig:

[user]
        email = asokolsky@company.com
        name = Alex Sokolsky

[github]
        user = asokolsky4company

[core]
        sshCommand = "ssh -i ~/.ssh/asokolsky4company.pem"

Personal Config

My personal projects are in ~/PersonalProjects/, my ~/PersonalProjects/.gitconfig:

# ~/PersonalProjects/.gitconfig
[user]
        email = asokolsky@gmail.com
        name = Alex Sokolsky

[github]
        user = asokolsky

[core]
        sshCommand = "ssh -i ~/.ssh/latitude_id_rsa"