79241563

Date: 2024-12-01 12:47:46
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Blacklisted phrase (1): help me
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Grégory Becker