If you use multiple accounts with Git (for instance, a work or personal GitHub account in addition to your GA GitHub Enterprise account), you need to configure git a bit differently than the default instructions outlined on github.com. Use this page as your guide for finishing your GitHub Enterprise setup.
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
This creates a new ssh key, using the provided email as a label.
/Users/[username]/.ssh/id_rsa_ga
where [username]
is your Mac username, and then press Enter.
eval "$(ssh-agent -s)"
The output should be Agent pid
followed by some numbers.
.ssh
folder, then open the file named config
(if this file doesn't exist, go to the terminal, run touch ~/.ssh/config
, then open the file in your editor.)
# my GitHub account
Host personal
HostName github.com
User git
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
# GA github Enterprise
Host GA
HostName git.generalassemb.ly
User git
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa_ga
IdentitiesOnly yes
# wildcard
Host *
AddKeysToAgent yes
UseKeychain yes
ssh-add -K ~/.ssh/id_rsa_ga
ssh -T git@git.generalassemb.ly
You should see output similar to:
Hi <you>! You've successfully authenticated, but GitHub does not provide shell access.