정보
Github 연결시 특정 ssh 키를 사용하는 방법
인디개발자
2024. 5. 17. 08:41
우선 본인의 ~/.ssh/config 에 다음과 같이 등록한다.
# user1
Host user1.github.com
HostName github.com
User git
IdentityFile ~/.ssh/user1/id_rsa
# user2
Host user2.github.com
HostName github.com
User git
IdentityFile ~/.ssh/user2/id_rsa
# user1 계정으로 사용하는 경우
git remote set-url origin git@user1.github.com:User1/UserRepo.git
git clone git@user1.github.com:User1/UserRepo.git
반응형