How to use multiple Github accounts with ssh keys
I write open source software, check my Github!
Ping me for collabs
Search for a command to run...
I write open source software, check my Github!
Ping me for collabs
No comments yet. Be the first to comment.
AppSignal deploy markers are a way to keep track of what git commit the bug happened, or when the slowdown started appearing in your app. https://docs.appsignal.com/application/markers/deploy-markers.html As long as you have an APP_REVISION environm...
Hey there, we're going to walk through deploying a Phoenix app to a DigitalOcean droplet, manually - no tools no nothing. Just straight up BASH! But don't worry, I've done the hard work so you don't have to. It occurred to me this week after seeing s...
It's generally a good idea to use binary ids / UUIds for the primary keys in your database. Here's how to easily do it in Rails 7, using Postgres! Configure your generators to use UUID for keys. Create a file in config/initializers/generators.rb Rail...
It's been really hard to figure this out and I had to cobble together many sources to get it working. Enjoy! We're going to build a direct image upload to Cloudflare B2 from the browser. That way the file doesn't travel to your servers and slow them...

Uploads files from your browser directly to your bucket.

I have my dev box and use it to write both personal projects and work related code.
Here's how to automatically use different ssh keys for different projects on the same machine.
Make sure you add your public keys to each of your github accounts. Pretty straightforward.
config file in ~/.sshInclude this:
# My github username is sergiotapia
Host github.com-sergiotapia
HostName github.com
User git
IdentityFile ~/.ssh/mypersonalidentity
IdentitiesOnly yes
# Assume my organization is called mycompany
Host github.com-mycompany
HostName github.com
User git
IdentityFile ~/.ssh/myworkidentity
IdentitiesOnly yes
There's two ways for you to go about this.
Clone the project using github.com-mycompany or github.com-sergiotapia.
git clone git@github.com-mycompany:mycompany/backend-api.git
# or your personal account
git clone git@github.com-sergiotapia:sergiotapia/backend-api.git
Set the git remote using the proper naming structure.
git remote remove origin
git remote add origin git@github.com-mycompany:mycompany/backend-api.git
# or your personal account
git remote remove origin
git remote add origin git@github.com-sergiotapia:sergiotapia/backend-api.git