Crear llave y agregarla a github#
Crear llave ssh:
1
| ssh-keygen -t ed25519 -C "tu_correo@ejemplo.com"
|
agregar llave al ssh-agent:
1
| ssh-add ~/.ssh/elvinguti_key
|
Agregar llave a github.
Actualizar ssh config file#
Edita ~/.ssh/config:
1
2
3
4
5
6
7
8
9
10
| Host github.com
HostName github.com
IdentityFile ~/.ssh/my_work_key
IdentitiesOnly yes
Host elvinguti.github.com
HostName github.com
User elvinguti
IdentityFile ~/.ssh/elvinguti_key
IdentitiesOnly yes
|
seguramente necesitaras reiniciar el ssh-agent:
1
| eval $(ssh-agent -s)
|
Ahora deberias ser capaz de clonar el repositorio o actualizar la url remota de git:
1
2
3
4
5
6
7
| # Formato de URL: git@host_del_alias:usuario/nombre_del_repo.git
# Repositorio existente
git remote set-url origin git@elvinguti.github.com:elvinguti/elvingutidev.git`
# Clonar repositorio
git clone origin git@elvinguti.github.com:elvinguti/elvingutidev.git
|