<?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: چودھری یاسر علی</title>
    <description>The latest articles on DEV Community by چودھری یاسر علی (@dhondooo).</description>
    <link>https://dev.to/dhondooo</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F954303%2Fb7730d42-1ad5-4953-a5a9-0970559acfed.jpg</url>
      <title>DEV Community: چودھری یاسر علی</title>
      <link>https://dev.to/dhondooo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhondooo"/>
    <language>en</language>
    <item>
      <title>How to Effortlessly Manage Multiple Accounts in GitHub Desktop (macOS)</title>
      <dc:creator>چودھری یاسر علی</dc:creator>
      <pubDate>Thu, 05 Mar 2026 17:24:50 +0000</pubDate>
      <link>https://dev.to/dhondooo/how-to-effortlessly-manage-multiple-accounts-in-github-desktop-macos-41bd</link>
      <guid>https://dev.to/dhondooo/how-to-effortlessly-manage-multiple-accounts-in-github-desktop-macos-41bd</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;** &lt;em&gt;Disclaimer:&lt;/em&gt;**&lt;em&gt;This guide and the accompanying scripts were generated with the assistance of AI. While the workflow has been tested, please double-check all terminal commands and scripts before running them on your own system!&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you use GitHub Desktop, you probably love its clean UI and seamless conflict resolution. But if you are a freelancer, an agency developer, or just someone juggling personal and work repositories, you’ve definitely hit its biggest limitation: &lt;strong&gt;GitHub Desktop does not natively support multiple accounts.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While there is a massive &lt;a href="https://github.com/desktop/desktop/issues/3707" rel="noopener noreferrer"&gt;official feature request for this&lt;/a&gt; that has been active for years, the maintainers unfortunately have it tagged as &lt;code&gt;not-planned&lt;/code&gt; for the foreseeable future.&lt;/p&gt;

&lt;p&gt;If you want to switch from your personal account to a client’s account, you have to manually sign out, sign back in, and re-configure your Git identity every single time.&lt;/p&gt;

&lt;p&gt;After getting frustrated with this, I built a fully automated terminal workflow for macOS that lets you swap GitHub Desktop profiles and Git identities in a split second using a single command.&lt;/p&gt;

&lt;p&gt;Here is how you can set it up.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Core Concept: The Symlink Trick
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;(Credit where credit is due: The foundational idea of swapping configuration folders via symlinks was inspired by&lt;/em&gt;&lt;a href="https://stackoverflow.com/a/79241563/7074839" rel="noopener noreferrer"&gt; &lt;em&gt;this clever Stack Overflow answer&lt;/em&gt;&lt;/a&gt; &lt;em&gt;. I’ve expanded on that concept here to include global Git identity swapping and a fully automated profile generation script.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;GitHub Desktop stores all of its session data, login tokens, and preferences in this directory: &lt;code&gt;~/Library/Application Support/GitHub Desktop&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;By renaming this folder (e.g., to &lt;code&gt;GitHub Desktop.config1&lt;/code&gt;) and creating a symbolic link (symlink) in its place, we can trick the application into loading different profiles whenever we swap the symlink out.&lt;/p&gt;

&lt;p&gt;Even better, we can chain this with standard &lt;code&gt;git config&lt;/code&gt; commands so that your commits always use the correct email address for the active profile!&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1: Add the Automation to Your &lt;code&gt;.zshrc&lt;/code&gt;
&lt;/h1&gt;

&lt;p&gt;Instead of doing this manually every time, we are going to add aliases and a smart bash function to your terminal configuration.&lt;/p&gt;

&lt;p&gt;Open your terminal and edit your zsh configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.zshrc

#
# =========================================================  
#
# 1. GITHUB DESKTOP &amp;amp; GIT IDENTITY SWITCHERS  
#
# =========================================================  
alias gitpersonal='ln -nfs "$HOME/Library/Application Support/GitHub Desktop.config1" "$HOME/Library/Application Support/GitHub Desktop" &amp;amp;&amp;amp; git config --global user.name "Your Name" &amp;amp;&amp;amp; git config --global user.email "personal@email.com" &amp;amp;&amp;amp; echo "Switched to Personal Profile (Config 1)"'  
alias gitwork='ln -nfs "$HOME/Library/Application Support/GitHub Desktop.config2" "$HOME/Library/Application Support/GitHub Desktop" &amp;amp;&amp;amp; git config --global user.name "Work Name" &amp;amp;&amp;amp; git config --global user.email "work@company.com" &amp;amp;&amp;amp; echo "Switched to Work Profile (Config 2)"'  
#
# =========================================================  
#
# 2. PROFILE MANAGEMENT AUTOMATION  
#
# =========================================================  
#
# Command to un-link and prepare for a fresh login  
alias gitnew='rm "$HOME/Library/Application Support/GitHub Desktop" &amp;amp;&amp;amp; echo "Delinked! Open GitHub Desktop to set up a fresh profile."'  
#
# Command to save a newly created profile and generate an alias automatically  
gitsave() {  
  if [ -z "$1" ]; then  
    echo "Usage: gitsave &amp;lt;alias_name&amp;gt; (e.g., gitsave gitclient)"  
    return 1  
  fi  
  local target_dir="$HOME/Library/Application Support/GitHub Desktop"  

  if [ -L "$target_dir" ] || [ ! -d "$target_dir" ]; then  
    echo "Error: No fresh setup found. Run 'gitnew', log in, close app, and try again."  
    return 1  
  fi  
  echo "Enter Git User Name for this profile (e.g., John Doe):"  
  read git_name  
  echo "Enter Git Email for this profile (e.g., john@example.com):"  
  read git_email  
  local num=1  
  while [ -d "${target_dir}.config${num}" ]; do  
    ((num++))  
  done  
  mv "$target_dir" "${target_dir}.config${num}"  

  local alias_cmd="alias $1='ln -nfs \"\$HOME/Library/Application Support/GitHub Desktop.config${num}\" \"\$HOME/Library/Application Support/GitHub Desktop\" &amp;amp;&amp;amp; git config --global user.name \"$git_name\" &amp;amp;&amp;amp; git config --global user.email \"$git_email\" &amp;amp;&amp;amp; echo \"Switched to ($1) Config ${num}\"'"  

  echo "" &amp;gt;&amp;gt; ~/.zshrc  
  echo "$alias_cmd" &amp;gt;&amp;gt; ~/.zshrc  

  source ~/.zshrc  
  echo "✅ Saved current profile as config${num} and added alias '$1' to .zshrc!"  
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file (&lt;code&gt;Ctrl + O&lt;/code&gt;, &lt;code&gt;Enter&lt;/code&gt;, &lt;code&gt;Ctrl + X&lt;/code&gt;) and reload your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Step 2: How to Use Your New Superpowers
&lt;/h1&gt;

&lt;p&gt;Now that the code is in place, managing your accounts is incredibly simple.&lt;/p&gt;

&lt;h1&gt;
  
  
  Switching Between Existing Profiles
&lt;/h1&gt;

&lt;p&gt;Ensure GitHub Desktop is &lt;strong&gt;closed&lt;/strong&gt;. Open your terminal and type your alias:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gitwork
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Boom.&lt;/em&gt; You are now logged into your work account, and any commits you make will automatically be attributed to your work email. Need to switch back? Close the app, type &lt;code&gt;gitpersonal&lt;/code&gt;, and you're done.&lt;/p&gt;

&lt;h1&gt;
  
  
  Adding a Brand New Profile (The Magic Workflow)
&lt;/h1&gt;

&lt;p&gt;This is where the &lt;code&gt;gitsave&lt;/code&gt; function shines. Let's say you just landed a new freelance client and need a dedicated GitHub account for them.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Close GitHub Desktop&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;gitnew&lt;/code&gt; in your terminal. &lt;em&gt;(This safely unlinks your current profile).&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open GitHub Desktop&lt;/strong&gt;. It will act like a brand-new installation! Log into your new client account and set up your preferences.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close GitHub Desktop&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Run your save command with whatever shortcut name you want to use:  &lt;code&gt;gitsave gitclient&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The terminal will ask you for the Git Name and Email you want to associate with this specific client.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The script will automatically move the folder to the next available slot (like &lt;code&gt;config3&lt;/code&gt;), dynamically write the new alias into your &lt;code&gt;.zshrc&lt;/code&gt; file, and reload your terminal. You can now type &lt;code&gt;gitclient&lt;/code&gt; anytime you want to work on their codebase!&lt;/p&gt;

&lt;h1&gt;
  
  
  Wrapping Up
&lt;/h1&gt;

&lt;p&gt;Until GitHub officially supports multi-account management in their desktop client, this symlink trick is an absolute lifesaver. It keeps your identities perfectly separated and completely removes the friction of logging in and out.&lt;/p&gt;

&lt;p&gt;Let me know in the comments if this workflow helped you clean up your Git environment! 🚀&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
