Reputation: 21
I am trying to add a second GitHub account to GitHub Desktop. I'm able to add a second account to github.com and easily switch between them, but there doesn't seem to be a simple way to do this in the UI of GitHub Desktop. I am not even trying to enable them to commit to each other's repos (though that would be a nice option to have). I simply want to be able to switch to a different account (Account B) and use the repos that B has and commit to those from Account B. Then, when I need to use my other account (Account A) I want to switch to Account A just like I can do on github.com. Once I have switched to Account A I want to be able to view its repos and commit to them.
I was able to find something that showed a work-around to enable something like this a few months ago, but it was on my old computer and I have not been able to find it again since. Every single site I have since come across is talking about using the CLI and SSH keys. That might be fine for many people but it's not what I'm trying to achieve here. The only thing that I've found that seems like it's kind of close is this but it still doesn't fully address the issue.
It seems there was a request submitted for this over 6 years ago... and has been upvoted a great many times. How is this still an issue in 2024?
Upvotes: 1
Views: 866
Reputation: 1
On MacOS, I have found that it is possible to switch between Github accounts by managing the content of the directory ~/Library/Application Support/Github
Desktop. I am using a few shell scripts & function that automatically detect, switch & restart Github Desktop depending on the repository I'm working with.
I'm using symbolic links to switch between different configuration, here is a very short simplification of it:
# To create _new_ configurations (just start Github Desktop to get a new/empty one afterwards)
mv "$HOME/Application Support/Github Desktop" "$HOME/Application Support/Github Desktop.config1"
# Then, to switch between different configurations
ln -nfs "$HOME/Application Support/Github Desktop.config1" "$HOME/Application Support/Github Desktop"
ln -nfs "$HOME/Application Support/Github Desktop.config2" "$HOME/Application Support/Github Desktop"
To be clear, I don't like having to do that myself and it is totally dependant on my ways of working with Github but I wanted to share that information as it seems to work fairly well and will help me survive until this feature is implemented natively within GitHub Desktop.
Upvotes: 0