I am trying to use a personal account and a more work-related account on Github.
So my first account is already working all fine. For my second account, is it possible just to go into my folder,
# make sure `git init` already and is a git repo
git config user.name "the other UserName" # note, without --global
git config user.email "the.other.email@gmail.com".
and now, create another ssh key, and add that public key to GitHub. (But I didn't go the ssh-agent part as on Github's instruction).
So from now on, whenever I want a project to be owned by the "alternative account", just go into that folder and set that local user. name
and user. email
by those 2 git config
lines above, and it should work?
But the thing is, I tried that and when I git push
, it says:
Please make sure you have the correct access rights and the repository exists.
Can I make it work by using this method?