I've followed the steps from here to create another git user because I want to set up multiple contributors to learn about git. Below is what I did
- create 2nd SSH key
- create 2nd github account and add SSH key
ssh-add ~/.ssh/second_rsain ~/.ssh/config
Host stackjlei.github.com HostName github.com IdentityFile ~/.ssh/second_rsaI git cloned a repo that I was original author of with
git clone [email protected]/Jacky-Lei/banana-app.gitbut it says repo doesn't exist so I just git cloned it like normalI made changes, added and committed. And then
git config --local user.email "[email protected]"andgit config --local user.name "stackjlei"I pushed but the repo still shows me as my original contributor (jacky-lei) account rather than my second account (stackjlei). How do I fix this?
git remote add). You can even modify the .git/config file by hand to change the URLs. I am however not sure if it will work (in your case I guess using ssh://git@... should work for clone). Might be easier to not use key based auth but https passwords.user.email/namebefore commit) will show different authors but still use the same commiter account. But I guess for playing around that is enough.