netgescon-day0/Miki-Bug-workspace/connessione_GIT.md

40 lines
1.9 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1) Comandi sulla macchina di sviluppo (che fa anche staging)
# 0) Variabili comodeexport GIT_HOST="git.netgescon.it"export GIT_PORT="2222"export GIT_USER="git"export GIT_REPO="michele/netgescon-laravel.git"   # cambia owner/repo se serve# 1) Genera chiave SSH dedicata NetGesconmkdir -p ~/.ssh && chmod 700 ~/.sshssh-keygen -t ed25519 -C "dev-staging-netgescon" -f ~/.ssh/id_ed25519_netgescon -N ""# 2) Avvia ssh-agent e carica chiaveeval "$(ssh-agent -s)"ssh-add ~/.ssh/id_ed25519_netgescon# 3) Mostra chiave pubblica da incollare in Gitea (Settings -> SSH Keys)cat ~/.ssh/id_ed25519_netgescon.pub# 4) Config SSH host dedicatocat >> ~/.ssh/config <<'EOF'Host git-netgescon  HostName git.netgescon.it  User git  Port 2222  IdentityFile ~/.ssh/id_ed25519_netgescon  IdentitiesOnly yes  StrictHostKeyChecking accept-newEOFchmod 600 ~/.ssh/config# 5) Test connessione SSH (non deve chiedere password)ssh -T git-netgescon
# 0) Variabili comode
export GIT_HOST="git.netgescon.it"
export GIT_PORT="2222"
export GIT_USER="git"
export GIT_REPO="michele/netgescon-laravel.git" # cambia owner/repo se serve
# 1) Genera chiave SSH dedicata NetGescon
mkdir -p ~/.ssh && chmod 700 ~/.ssh
ssh-keygen -t ed25519 -C "dev-staging-netgescon" -f ~/.ssh/id_ed25519_netgescon -N ""
# 2) Avvia ssh-agent e carica chiave
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519_netgescon
# 3) Mostra chiave pubblica da incollare in Gitea (Settings -> SSH Keys)
cat ~/.ssh/id_ed25519_netgescon.pub
# 4) Config SSH host dedicato
cat >> ~/.ssh/config <<'EOF'
Host git-netgescon
HostName git.netgescon.it
User git
Port 2222
IdentityFile ~/.ssh/id_ed25519_netgescon
IdentitiesOnly yes
StrictHostKeyChecking accept-new
EOF
chmod 600 ~/.ssh/config
# 5) Test connessione SSH (non deve chiedere password)
ssh -T git-netgescon