<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Deepanshu Jangra</title>
    <description>The latest articles on DEV Community by Deepanshu Jangra (@deepanshujangra).</description>
    <link>https://dev.to/deepanshujangra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1174212%2F81d106a8-d01f-4cb1-9633-bde500550829.jpg</url>
      <title>DEV Community: Deepanshu Jangra</title>
      <link>https://dev.to/deepanshujangra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deepanshujangra"/>
    <language>en</language>
    <item>
      <title>Two GitHub Accounts, One Laptop, Zero Regrets</title>
      <dc:creator>Deepanshu Jangra</dc:creator>
      <pubDate>Tue, 04 Aug 2026 10:05:18 +0000</pubDate>
      <link>https://dev.to/deepanshujangra/two-github-accounts-one-laptop-zero-regrets-4l30</link>
      <guid>https://dev.to/deepanshujangra/two-github-accounts-one-laptop-zero-regrets-4l30</guid>
      <description>&lt;p&gt;There's a specific flavor of embarrassment that only developers know.&lt;/p&gt;

&lt;p&gt;It's 11 PM. You've just finished a weekend project you're genuinely proud of. You push it to your personal GitHub, open the repo in your browser to admire it, and there it is at the top of the commit list:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="mailto:developer@company.com"&gt;developer@company.com&lt;/a&gt;&lt;/strong&gt; committed 2 minutes ago&lt;/p&gt;

&lt;p&gt;Your work email. On your personal project. Sitting in a public repo. Forever.&lt;/p&gt;

&lt;p&gt;Nobody's going to fire you over it. But it looks sloppy, it quietly announces which company you work at to every stranger who reads your code, and — the part that actually stings — it means the commit doesn't show up on your personal contribution graph. All those little green squares you earned at midnight? They went to an account that doesn't even know they exist.&lt;/p&gt;

&lt;p&gt;I did this for about two years before I fixed it. Here's the fix, and more importantly, here's every way I managed to get it wrong first.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this happens
&lt;/h2&gt;

&lt;p&gt;Git has exactly one global identity, stored in &lt;code&gt;~/.gitconfig&lt;/code&gt;. When you set it up on day one at a new job, you type in your work email, and Git dutifully stamps that on every commit you make on that machine for the rest of time.&lt;/p&gt;

&lt;p&gt;Git does not know the difference between &lt;code&gt;~/work/critical-production-service&lt;/code&gt; and &lt;code&gt;~/study/thing-i-made-at-2am&lt;/code&gt;. It's a version control system, not a mind reader. To Git, it's all just directories.&lt;/p&gt;

&lt;p&gt;So we have to tell it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 1: Teach Git to read the room
&lt;/h2&gt;

&lt;p&gt;Git has a feature called &lt;strong&gt;conditional includes&lt;/strong&gt;, and it is the single most underrated thing in the entire tool. It lets you say: &lt;em&gt;"if the repo lives in this folder, use a different identity."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;First, make a file for your personal identity. Call it &lt;code&gt;~/.gitconfig-personal&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[user]&lt;/span&gt;
    &lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;Your Name&lt;/span&gt;
    &lt;span class="py"&gt;email&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;your.personal@gmail.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, at the &lt;strong&gt;bottom&lt;/strong&gt; of your existing &lt;code&gt;~/.gitconfig&lt;/code&gt;, add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[includeIf "gitdir:~/study/"]&lt;/span&gt;
    &lt;span class="py"&gt;path&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;~/.gitconfig-personal&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;~/study/&lt;/code&gt; with wherever your personal projects live. Mine is &lt;code&gt;~/study/&lt;/code&gt;, because I started that folder to learn things and never renamed it.&lt;/p&gt;

&lt;p&gt;Two details that will bite you if you skip them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The trailing slash matters.&lt;/strong&gt; &lt;code&gt;gitdir:~/study/&lt;/code&gt; means "this folder and everything inside it." Without the slash, Git gets picky in ways you don't want to debug at midnight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It must go at the bottom.&lt;/strong&gt; Git reads the config top to bottom, and the last value wins. If you paste the &lt;code&gt;includeIf&lt;/code&gt; block &lt;em&gt;above&lt;/em&gt; your &lt;code&gt;[user]&lt;/code&gt; section, your work email will override the personal one and you'll spend twenty minutes convinced the feature is broken. It is not broken. You are just at the wrong altitude in the file. (Ask me how I know.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Verify it worked
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/study/any-project
git config user.email     &lt;span class="c"&gt;# should print your personal email&lt;/span&gt;

&lt;span class="nb"&gt;cd&lt;/span&gt; ~/work/any-project
git config user.email     &lt;span class="c"&gt;# should print your work email&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the personal folder still shows work email, check two things: is the &lt;code&gt;includeIf&lt;/code&gt; at the bottom, and &lt;strong&gt;is that folder actually a Git repo?&lt;/strong&gt; Conditional includes evaluate against a repository's location. Run it in a folder with no &lt;code&gt;.git&lt;/code&gt; in it and Git shrugs and gives you the global default. This confused me for a solid ten minutes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: The keys to two kingdoms
&lt;/h2&gt;

&lt;p&gt;Identity is only half the problem. The other half is &lt;em&gt;authentication&lt;/em&gt; — proving to GitHub that you're allowed to push.&lt;/p&gt;

&lt;p&gt;Your laptop has one SSH key. GitHub has a rule: &lt;strong&gt;one key, one account.&lt;/strong&gt; You cannot add the same public key to two different GitHub accounts. GitHub will look at it, recognize it, and tell you it's already in use, in the tone of a bouncer who remembers your face.&lt;/p&gt;

&lt;p&gt;So: second key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your.personal@gmail.com"&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; ~/.ssh/id_ed25519_personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note the &lt;code&gt;-f&lt;/code&gt; flag. It gives the key a specific name instead of overwriting &lt;code&gt;~/.ssh/id_rsa&lt;/code&gt;. Do not skip this. Your existing key probably has access to production servers, deploy targets, and other things that are extremely annoying to re-provision because you were typing fast.&lt;/p&gt;

&lt;p&gt;Copy the public half:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pbcopy &amp;lt; ~/.ssh/id_ed25519_personal.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then go to GitHub → Settings → SSH and GPG keys → New SSH key, and paste it in. &lt;strong&gt;Make sure you're logged into your personal account.&lt;/strong&gt; If you add your personal key to your work account, everything will appear to work until it very much doesn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: The alias that makes it all click
&lt;/h2&gt;

&lt;p&gt;Here's the clever bit. You now have two keys, but when you run &lt;code&gt;git push&lt;/code&gt;, SSH has no idea which one to use. It'll just offer them in order and hope.&lt;/p&gt;

&lt;p&gt;So you invent a hostname that doesn't exist.&lt;/p&gt;

&lt;p&gt;Add this to &lt;code&gt;~/.ssh/config&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ssh"&gt;&lt;code&gt;&lt;span class="k"&gt;Host&lt;/span&gt; github-personal
    &lt;span class="k"&gt;HostName&lt;/span&gt; github.com
    &lt;span class="k"&gt;User&lt;/span&gt; git
    &lt;span class="k"&gt;IdentityFile&lt;/span&gt; ~/.ssh/id_ed25519_personal
    &lt;span class="k"&gt;IdentitiesOnly&lt;/span&gt; &lt;span class="no"&gt;yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read that carefully, because it's doing something sneaky. &lt;code&gt;github-personal&lt;/code&gt; isn't a real domain. It's a nickname. When you tell Git to connect to &lt;code&gt;github-personal&lt;/code&gt;, SSH looks it up in this config, sees "oh, that means github.com, and use &lt;em&gt;this specific key&lt;/em&gt;," and does the right thing.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IdentitiesOnly yes&lt;/code&gt; is the load-bearing line. Without it, SSH helpfully offers &lt;em&gt;every&lt;/em&gt; key it knows about, starting with your work one. GitHub accepts the first valid key it sees, so you authenticate as the wrong account and get a confusing permission error about a repo you're literally staring at in your browser.&lt;/p&gt;

&lt;p&gt;Now use the alias in your remote URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin git@github-personal:yourusername/your-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything after the colon is normal. Only the host part changed.&lt;/p&gt;

&lt;p&gt;Test it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github-personal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You want: &lt;code&gt;Hi yourusername! You've successfully authenticated...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If it greets you by your &lt;em&gt;work&lt;/em&gt; username, &lt;code&gt;IdentitiesOnly&lt;/code&gt; is missing or misspelled.&lt;/p&gt;




&lt;h2&gt;
  
  
  The four errors you are about to hit
&lt;/h2&gt;

&lt;p&gt;I hit all of these. In order. Consider this the walkthrough.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;ssh: Could not resolve hostname github-personal&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;You used the alias before creating it. SSH looked for a real server called &lt;code&gt;github-personal&lt;/code&gt;, found nothing, and gave up. Go back and add the &lt;code&gt;Host&lt;/code&gt; block to &lt;code&gt;~/.ssh/config&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The reason this error is confusing is that it &lt;em&gt;sounds&lt;/em&gt; like a network problem. It isn't. It's a "you invented a nickname and forgot to write it down" problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;fatal: refusing to merge unrelated histories&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;You created the repo on GitHub with the "Add a README" checkbox ticked, so GitHub made a commit. Meanwhile you made your own first commit locally. Two separate histories, no common ancestor, and Git — reasonably — refuses to guess.&lt;/p&gt;

&lt;p&gt;If the remote only contains GitHub's auto-generated stub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If there's anything on the remote you actually care about:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git pull origin main &lt;span class="nt"&gt;--allow-unrelated-histories&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;...and then resolve the conflict like an adult. Check &lt;code&gt;git log origin/main&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; you force anything. Force pushes are permanent, and "I thought it was empty" is not a recovery strategy.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;remote: Permission to user/repo.git denied&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Wrong key got offered. Either &lt;code&gt;IdentitiesOnly yes&lt;/code&gt; is missing, or you added the public key to the wrong GitHub account.&lt;/p&gt;

&lt;h3&gt;
  
  
  The HTTPS trap
&lt;/h3&gt;

&lt;p&gt;This one is the sneakiest, because nothing errors — it just silently does the wrong thing.&lt;/p&gt;

&lt;p&gt;If your remote starts with &lt;code&gt;https://github.com/...&lt;/code&gt; instead of &lt;code&gt;git@...&lt;/code&gt;, none of your SSH setup applies. On macOS, Git pulls credentials from the Keychain, where your work account's token has been quietly living since your first day. It'll use that. Every time.&lt;/p&gt;

&lt;p&gt;Check your remotes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;https://&lt;/code&gt;, switch it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote set-url origin git@github-personal:yourusername/your-repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And if you need to evict the stored credential:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'protocol=https\nhost=github.com\n\n'&lt;/span&gt; | git credential-osxkeychain erase
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Was it worth it?
&lt;/h2&gt;

&lt;p&gt;Fifteen minutes of setup. Then it just... works. Forever. Silently.&lt;/p&gt;

&lt;p&gt;I clone a personal project into &lt;code&gt;~/study/&lt;/code&gt;, and it's me. I clone a work repo anywhere else, and it's work me. I have never once had to think about it since, which is the highest compliment you can pay to any piece of configuration.&lt;/p&gt;

&lt;p&gt;The green squares go to the right account now. My work email isn't scattered across public repos. And when a recruiter opens my GitHub, they see a person with side projects — not a person who apparently does side projects on company time.&lt;/p&gt;

&lt;p&gt;That last one wasn't even true. But it sure looked like it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this saved you from an awkward commit history, drop a heart. If you're reading this because you already pushed with the wrong email — &lt;code&gt;git commit --amend --author="Name &amp;lt;email&amp;gt;"&lt;/code&gt; fixes the last one, and &lt;code&gt;git rebase&lt;/code&gt; fixes the rest, but that's a whole other article and honestly, sometimes you just start a fresh repo and move on with your life.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>mac</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Install NVM and Node on macOS M1 Silicon in 2023</title>
      <dc:creator>Deepanshu Jangra</dc:creator>
      <pubDate>Sun, 01 Oct 2023 08:40:10 +0000</pubDate>
      <link>https://dev.to/deepanshujangra/how-to-install-nvm-and-node-on-macos-m1-silicon-in-2023-3617</link>
      <guid>https://dev.to/deepanshujangra/how-to-install-nvm-and-node-on-macos-m1-silicon-in-2023-3617</guid>
      <description>&lt;p&gt;As a software engineer working on a Mac with an M1 Silicon chip, having NVM (Node Version Manager) and Node.js installed is crucial. In 2023, setting up your development environment for Node.js on an M1 Mac is easier than ever. In this guide, we'll walk you through the steps to install NVM and Node.js, enabling you to streamline your development workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Get NVM&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check for .zshrc Profile&lt;/strong&gt;: Open a new terminal window and run the following command to check if you already have a .zshrc profile:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;.zshrc&lt;/code&gt; in the list, you can skip this step. However, if it's not there, you need to create one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;touch&lt;/span&gt; .zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install NVM&lt;/strong&gt;: Now that you have a .zshrc profile, it's time to install NVM. Visit the official NVM GitHub repository [&lt;a href="https://github.com/nvm-sh/nvm#install--update-script"&gt;here&lt;/a&gt;] to find the NVM cURL install command. The command should look something like this:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;curl &lt;span class="nt"&gt;-o-&lt;/span&gt; https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy this command and paste it into your terminal. This will download and install NVM, making it available for use.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Refresh .zshrc&lt;/strong&gt;: As this installation affects your .zshrc profile, you should run the following command to update it:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt; .zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations, you now have NVM installed on your Mac!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Get Node&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Node&lt;/strong&gt;: To install Node.js using NVM, simply run this command in your terminal:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;nvm &lt;span class="nb"&gt;install &lt;/span&gt;node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will download and install the latest version of Node.js.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Activate Node&lt;/strong&gt;: While Node.js is now downloaded, you need to activate it to use it. Run the following command:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;$ &lt;/span&gt;nvm use node
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command sets the recently installed Node.js version as the active one.&lt;/p&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
You've successfully set up NVM and installed Node.js on your macOS M1 Silicon-based machine. This streamlined process ensures you have the tools necessary for your development tasks in 2023. With NVM and Node.js at your disposal, you can easily manage Node.js versions and enjoy a smooth development experience on your M1 Mac.&lt;/p&gt;

&lt;p&gt;By following these steps, you'll be well-prepared to tackle your software development projects on your Mac with confidence. Happy coding!&lt;/p&gt;

</description>
      <category>mac</category>
      <category>node</category>
      <category>nvm</category>
      <category>m1</category>
    </item>
    <item>
      <title>Installing Homebrew on Apple Silicon: A Step-by-Step Guide</title>
      <dc:creator>Deepanshu Jangra</dc:creator>
      <pubDate>Sun, 01 Oct 2023 08:29:18 +0000</pubDate>
      <link>https://dev.to/deepanshujangra/installing-homebrew-on-apple-silicon-a-step-by-step-guide-131</link>
      <guid>https://dev.to/deepanshujangra/installing-homebrew-on-apple-silicon-a-step-by-step-guide-131</guid>
      <description>&lt;p&gt;As a software developer, having the right tools at your disposal is essential. Homebrew is a popular package manager for macOS that simplifies the process of installing and managing software packages. If you're using an Apple Silicon-based Mac, you might encounter some specific steps during the installation process. In this guide, we'll walk you through the steps to install Homebrew on Apple Silicon, ensuring a smooth and hassle-free experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Open a Terminal Window
&lt;/h3&gt;

&lt;p&gt;To get started, open a terminal window. Make sure you're using the zsh shell, which is the default shell on macOS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Run the Installation Command
&lt;/h3&gt;

&lt;p&gt;Copy and paste the following command into your terminal and press Enter:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
This command will begin the Homebrew installation process. During the installation, if you encounter any errors, don't worry; we'll address them shortly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Handle Installation Errors
&lt;/h3&gt;

&lt;p&gt;In some cases, you might encounter errors during the installation process. If this happens, you can try running the installation command again. In most cases, running it a second time resolves the issue.&lt;/p&gt;

&lt;p&gt;After successful installation, you will likely see a message indicating "Installation successful!" However, you may also see a warning that "/opt/homebrew/bin is not in your PATH." We'll fix this in the next steps.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Create the .zshrc File
&lt;/h3&gt;

&lt;p&gt;If you don't already have a .zshrc file in your home directory, you can create one by running the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;touch ~/.zshrc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command will create the .zshrc file if it doesn't already exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Edit the .zshrc File
&lt;/h3&gt;

&lt;p&gt;Open the .zshrc file for editing using your preferred text editor. You can use TextEdit or any text editor of your choice. The .zshrc file is a hidden file, so you can reveal hidden files in Finder by pressing Shift + Command + Period (⇧⌘.).&lt;/p&gt;

&lt;p&gt;Add the following line at the end of the .zshrc file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;export PATH=/opt/homebrew/bin:$PATH&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This line adds the Homebrew bin directory to your PATH environment variable, allowing you to use Homebrew commands system-wide.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Source the .zshrc File
&lt;/h3&gt;

&lt;p&gt;To make the changes in your .zshrc file take effect, run the following command in your terminal:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;source ~/.zshrc&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This command reloads your shell configuration with the updated PATH variable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: Verify Homebrew Installation
&lt;/h3&gt;

&lt;p&gt;To ensure that Homebrew is correctly installed and configured, run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew help&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If Homebrew is installed and set up correctly, you will see a list of available Homebrew commands and options.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;Congratulations! You've successfully installed Homebrew on your Apple Silicon-based Mac and configured it to work seamlessly. Now you can use Homebrew to install and manage software packages with ease, making your development tasks more efficient.&lt;/p&gt;

&lt;p&gt;By following these steps, you'll have Homebrew up and running, ready to help you with your software development projects. Enjoy the convenience of package management on your Apple Silicon Mac!&lt;/p&gt;

</description>
      <category>apple</category>
      <category>m1</category>
      <category>homebrew</category>
      <category>mac</category>
    </item>
  </channel>
</rss>
