One Mac, Many Gits to Rule Them All

Mastering the Art of Multitasking GitHub Accounts on Your Apple Silicon Mac

Happy Tuesday (because I forgot to post yesterday)!?Time to make your week awesome! Today’s Data Bytes calories: 669 words … 4 minutes.

??What I’m reading -?Building LLM applications for production-??Chip Huyen?digs deep into the challenges of productionalizing LLM applications, exposure of LLM limitations due to lack of engineering rigor/good practices, and some cool, enterprise-level applications.

??What I’m working on -?Last week I introduced the my first end-to-end web app,?Heat Pace Planner. I’ve fixed some bugs and currently working on updating the pace adjustments to take air quality (AQI) into account.


One Big Thing: Manage Multiple GitHub Accounts on MacOS (with Apple silicon)

No alt text provided for this image
Image from Analytics Vidhya

Why do developers always have a backup plan?

Because they’re always ready to (git) commit and (git) push through any situation!

Do you have multiple GitHub accounts for different project and/or personal and professional work? Every try to push a commit to a remote repository only to get an unauthorized error and realize the local repository is tied to the incorrect credentials? Multiple GitHub accounts are common for personal and professional projects. Follow this step-by-step guide to streamline your workflow and seamlessly switch between accounts using SSH keys.

Step 1: Install Git & SSH Tools

? Make sure Git is installed: `$ git --version`

? Update to the latest version: `$ brew upgrade git`

? Verify SSH tools: `$ ssh -V`

? Update SSH tools (if needed): `$ brew install openssh`

Step 2: Create SSH keys for each account

Personal account example: `$ ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519_personal`

? Work account example: `$ ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519_work`

? Enter a passphrase for each key (optional, but recommended).

Step 3: Add SSH keys to SSH agent

? Run: `$ eval "$(ssh-agent -s)"`

? Add personal key: `$ ssh-add ~/.ssh/id_ed25519_personal`

? Add work key: `$ ssh-add ~/.ssh/id_ed25519_work`

Step 4: Create SSH config file

? Create a config file: `$ touch ~/.ssh/config`

? Open with a text editor, then add these entries:

Host github.com-persona

?HostName github.com

?User git

?IdentityFile ~/.ssh/id_ed25519_personal




Host github.com-work

?HostName github.com

?User git

?IdentityFile ~/.ssh/id_ed25519_work
        

Step 5: Add SSH keys to GitHub accounts

? Copy personal key: `$ pbcopy < ~/.ssh/id_ed25519_personal.pub`

? Paste into GitHub Personal Settings > SSH & GPG keys > New SSH key.

? Repeat for work key, copying & pasting `~/.ssh/id_ed25519_work.pub`.

Step 6: Configure Git user details

? Set global user details (I usually set this to whichever credentials I use the most):

?$ git config --global user.name "Your Name

?$ git config --global user.email "[email protected]""        

? Configure local user details for each repository (for local repositories that don’t use the default global credentials):

?$ cd /path/to/your/personal/repositor

?$ git config user.name "Your Name"

?$ git config user.email "[email protected]"y        

Step 7: Clone & use repositories

? Clone personal repo: `$ git clone [email protected]:username/repo.git`

? Clone work repo: `$ git clone [email protected]:username/repo.git`

? Seamlessly switch between accounts & repositories by configuring local repository user details where needed.

Git Commit …

? M1 Mac users can now manage multiple GitHub accounts with ease.

? Utilize SSH keys to simplify authentication & streamline workflow.

? Enjoy an efficient GitHub experience on your M1 Mac.

No alt text provided for this image

Helpful Resources


?? One last bite

“Sometimes the mistakes are what makes a work great. Humanity breathes in mistakes.” ~ Rick Rubin, The Creative Act: A Way of Being

Thank you for reading Data Bytes. This post is public, so feel free to share it.

要查看或添加评论,请登录

Jessica Rudd, PhD, MPH, PStat?的更多文章

  • Bridging the (Analytics) Culinary Gap - Part 3

    Bridging the (Analytics) Culinary Gap - Part 3

    Let's break open the data pantry! Happy Monday! Another week of tasty treats! Today’s Data Bytes calories: 890 words ……

  • Bridging the (Analytics) Culinary Gap - Part 2

    Bridging the (Analytics) Culinary Gap - Part 2

    It's time for the Sous Chef! Happy Tuesday! Another week of tasty treats! Today’s Data Bytes calories: 2,674 words … 13…

  • Bridging the Culinary Gap: A Delicious Data Journey with ETL!

    Bridging the Culinary Gap: A Delicious Data Journey with ETL!

    Happy Monday and Happy New Year! After a year hiatus, DataBytes is back with more tasty data dishes! Today’s Data Bytes…

    2 条评论
  • Why Heuristics Still Matter

    Why Heuristics Still Matter

    While AI and ML are all the rage, it's crucial to remember that they aren't always the silver bullet for every business…

    1 条评论
  • Take the Reigns of the Cloud

    Take the Reigns of the Cloud

    Mastering gcloud Multi-Account Manuevers! Happy Monday! Time to make your week awesome! Today’s Data Bytes calories:…

    1 条评论
  • Hook, Line, and Cleaner

    Hook, Line, and Cleaner

    A primer for pristine python and precise pre-commit prowess Happy Monday! Time to make your week awesome! Today’s Data…

  • Feeling the heat (of my first app development)??

    Feeling the heat (of my first app development)??

    Do or do not..

    2 条评论
  • The Art of the Chill Week

    The Art of the Chill Week

    Happy Monday! Time to make your week awesome! Today’s Data Bytes calories: 369 words … 2 minutes. ??Join Google…

  • Going Mad for March Madness ??

    Going Mad for March Madness ??

    Happy Monday! Time to make your week awesome! Today’s Data Bytes calories: 781 words … 4 minutes. ??Join Google…

  • JavaScript vs. Python: The Data Engineering Duel ??

    JavaScript vs. Python: The Data Engineering Duel ??

    Happy Monday! Time to make your week awesome! Today’s Data Bytes calories: 646 words … 3 minutes. ??Join Google…

    2 条评论

社区洞察

其他会员也浏览了