How to use multiple Git accounts in one machine
2022. 1. 28. 01:05ㆍDev Tools/Git
Introduction
나의 2015년형 맥북 프로가 스티브잡스형 곁으로 떠날 때가 되어서, 요즘엔 개인적인 공부를 할 때도 가끔 회사 랩탑을 사용하고 있다. 그런
데 깃헙에 커밋을 하면 다른 계정이라서, 커밋기록이 남지 않아서 한 개 머신에서 여러개 깃 계정을 설정해서 사용하는 법을 검색해 보았다.
자세한 방법은 나중에 업데이트 하도록 하고, 우선은 링크만 공유해두자..
How to Git clone
//git clone using personal account
git clone git@github.com-personal_id:githubAccount/repository.git
//git clone using work account
git clone git@github.com-work_id:githubAccount/repository.git
How to git configure
We need to git configure at local to avoid git conflict.
git config --local user.name "Your Name"
git config --local user.email "Your Email"
Link:
https://cursos.alura.com.br/forum/topico-fatal-local-can-only-be-used-inside-a-git-repository-184614
https://www.hostinger.com/tutorials/how-to-install-and-use-nano-text-editor
https://gist.github.com/Jonalogy/54091c98946cfe4f8cdab2bea79430f9
https://1ilsang.dev/2020-02-30/devtip/github-multi-auth
Generating a new SSH key and adding it to the ssh-agent - GitHub Docs