Skip to content

Instantly share code, notes, and snippets.

View kfox's full-sized avatar

Kelly Fox kfox

  • Unity Technologies
  • Austin, TX, USA
View GitHub Profile
@kfox
kfox / asdf and direnv.md
Created December 2, 2021 02:26
Keeping two or more SCM accounts separate using asdf and direnv

Keeping SCM accounts separate using asdf and direnv

These instructions will enable you to use different SSH keys for different accounts across different Source Code Management (SCM) providers like GitHub, Gitlab, and others, including internal on-prem versions of those providers. You can also use this approach to switch between multiple accounts for a single SCM provider, e.g. a personal Github account and a work Github account.

Installation and Setup

  1. Install asdf by following the Getting Started instructions. asdf is the tool used to manage any number of versions of various programming language runtimes or environments. You can use asdf and the appropriate asdf plugins to replace separate tools like nvm, pyenv, rvm, etc.

  2. Install the direnv plugin for asdf per these instructions. Direnv is the bit that "automagially"