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 truegit 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
yesse 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_neninja
Host gitlab.com
Hostname altssh.gitlab.com
Port 443
User git
IdentityFile ~/.ssh/id_rsa-gitlab
GPG
Para tornar os commits verificados no Github:
- Gere a chave
gpg --full-generate-key
Escolha
RSAe0para não expirar, informe seu nome e e-mail, configure senha (pode ser em branco) e confirmeListe as chaves
gpg --list-secret-keys --keyid-format=long
- Pegue o id da chave que está em
sec rsa4096/IDDACHAVE 2022-08-03 [SC] - Exiba a chave
gpg --armor --export IDDACHAVE
- Copie todo conteúdo, incuindo
-----BEGIN PGP PUBLIC KEY BLOCK-----até-----END PGP PUBLIC KEY BLOCK-----e salve no Github (Settings > GPG > New GPG key) - Atualize o git
git config --global --unset gpg.format
git config --global user.signingkey IDDACHAVE
git config --global commit.gpgsign true