본문으로 건너뛰기

Github 초기화

Prequisites​

GitHub 계정​

SSH Key 생성​

SSH Key 생성​

PS> ssh-keygen -t ed25519 -C "foo@example.com" -f ~/.ssh/id_github_foo
PS> ssh-keygen -t ed25519 -C "bar@example.com" -f ~/.ssh/id_github_bar

다중 SSH Key​

복수 SSH Key 생성​

PS> ssh-keygen -t ed25519 -C "foo@example.com" -f ~/.ssh/id_github_foo
PS> ssh-keygen -t ed25519 -C "bar@example.com" -f ~/.ssh/id_github_bar

SSH Key 등록​

PS> notepad $env:USERPROFILE/.ssh/config
~/.ssh/config
 ### github
Host github.com-foo
HostName github.com
AddKeysToAgent yes
User git
IdentityFile ~/.ssh/id_github_foo

Host github.com-bar
HostName github.com
AddKeysToAgent yes
User git
IdentityFile ~/.ssh/id_github_bar

git repository 설정​

foo의 저장소​

PS> notepad some_repository_of_foo/.git/config
some_repository_of_foo/.git/config
[url "git@github.com-foo"]
insteadOf = git@github.com

bar의 저장소​

PS> notepad some_repository_of_bar/.git/config
some_repository_of_bar/.git/config
[url "git@github.com-bar"]
insteadOf = git@github.com