1. SSH Key তৈরি
--> ssh-keygen -t ed25519 -C "nomanit-vps-github"
Public key দেখুন:
--> cat ~/.ssh/id_ed25519.pub
এই key GitHub → Settings → SSH and GPG keys → New SSH Key-এ add করুন।
2. SSH Config
cat > ~/.ssh/config << 'EOF'
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
EOF
chmod 600 ~/.ssh/config3. GitHub Connection Test
--> ssh -T git@github.com
সফল হলে:
-->Hi nomancse19! You've successfully authenticated, but GitHub does not provide shell access.
4. Private Repository-তে SSH Remote সেট করুন
HTTPS:
--> https://github.com/username/repository.git
এর পরিবর্তে SSH:
--> git@github.com:username/repository.git
উদাহরণ:
--> git remote set-url origin git@github.com:nomancse19/nomanit.git
Verify:
--> git remote -v
5. Repository Access Test
--> git ls-remote origin
এটি remote repository-এর branch/ref information দেখাবে এবং কোনো file পরিবর্তন করবে না।
এরপর সাধারণভাবে:
git fetch origin
git pull origin main
git push origin main