Here is the general step requires to automatically switch to different accounts of GitHub based on the current working directory:
- Create a different set of private-public key using
ssh-keygen
command. - Add the new public key to the other Github account's SSH keys.
- If there's no
~/.gitconfig
file presented, create a new file with content that will be described in later section. - Create extend config for git that will only applied when go to a specific folder, the content will be described in later section.
- Clone the fork repository, then add new remote using
git remote add
command.