Joined April 2019
·

cryptokkie

Hi @mejt @Mateusz Książek,
Thanks a lot for this write up!
I have been wasting my time with other tutorials for hours but fortunately bumped into your article.

Final not about example #1:
For home.github.com or company.github.com to work, the remote origin of the repository must be set accordingly.

Example

If the ssh link to the repository is: git@github.com:BLA/REPOSITORY.git

To use the home account:
git remote set-url origin git@home.github.com:BLA/REPOSITORY.git

To use the company account:
git remote set-url origin git@company.github.com:BLA/REPOSITORY.git

Because in the config file the real host is specified with the variable HostName, the bogus/made up/non existent domain home.github.com will be translated to the value in HostName i.e.: github.com.

# Home account
Host home.github.com
  HostName github.com
Achievements
1 Karma
0 Total ProTip Views