As configurações mínimas necessárias são:
git config --global user.name "Seu Nome Aqui"
git config --global user.email "seuemail@mail.com"
git config --global color.ui true
git config --global core.editor "seu editor de texto favorito"
SSH
- Instalar gerador de ssh
- ubuntu:
sudo apt install openssh-client
- ubuntu:
- Gerar chave
ssh-keygen -t rsa -C "my@email.com"
- Pode dar enter em todas opções
- Ver chave pública (
.ssh/id_rsa.pub
) e colocar no githubcat $HOME/.ssh/id_rsa.pub
- Permitir uso da ssh pelo github/gitlab
ssh -T git@github.com
- Responder
yes
se questionado
- Responder
Caso existam multiplas keys o ideal é configurar no arguivo ~/.ssh/config
.
Exemplo de uma configuração abaixo:
Host github.com-oab
Hostname ssh.github.com
Port 443
User git
IdentityFile ~/.ssh/id_rsa
Host github.com
Hostname ssh.github.com
Port 443
User git
IdentityFile ~/.ssh/id_rsa_nenitf
Host gitlab.com
Hostname altssh.gitlab.com
Port 443
User git
IdentityFile ~/.ssh/id_rsa-gitlab