Skip to content

Instantly share code, notes, and snippets.

@unsafe9
Last active June 27, 2025 09:58
Show Gist options
  • Select an option

  • Save unsafe9/e17956640d9057fe0aaaf9a0174656c9 to your computer and use it in GitHub Desktop.

Select an option

Save unsafe9/e17956640d9057fe0aaaf9a0174656c9 to your computer and use it in GitHub Desktop.

~/.gitconfig

[user]
  name = personal_name
  email = personal_email@google.com

[includeIf "gitdir:~/workspace/work/"]
  path = ~/.gitconfig-work

~/.gitconfig-work

[user]
  name = work_name
  email = work_email@company.com

# for github organization
[url "git@github.company.com:"]
  insteadOf = https://git.521000.bestpany.com/

~/.ssh/config

# for github organization
Host github.company.com
  HostName github.company.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/work_ssh_key

done

You can now clone your work repositories to the ~/workspace/work/ directory via SSH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment