How I Fixed the “Permission Denied” Error with Multiple GitHub Accounts
For a long time, I only used Atlassian tools like Bitbucket for work. Managing my accounts there was easy. Later, I joined a company that used GitHub for everything. I set up my work computer, added my company SSH key, and started working. Everything was fine until I tried to work on my own personal project. I typed a simple git push , and I got this big error: git push ERROR: Permission to zudheer/site.git denied to ksudheer. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. The problem was that GitHub saw I was trying to change my personal code ( zudheer/site.git ) using my work account ( ksudheer ). Because the accounts did not match, it blocked me. I needed a way to use both my work account and my personal account on the same computer without constantly logging in and out or copying passwords. After doing some research, I found a great trick using the SSH config file. Here is exactly how I fixed...