Automate git pull securely

✅ Best setup for your repo server (recommended): SSH deploy key

This is the standard production approach.

1. On the server: create an SSH key

ssh-keygen -t ed25519 -C "emblem-ergani-server"

Press Enter for default path:

/root/.ssh/id_ed25519


2. Show the public key

cat ~/.ssh/id_ed25519.pub

Copy it.


3. Add it to your GitHub repo

Go to:

👉 Repo → Settings → Deploy keys → Add key

Paste the key.

Important choice:


4. Switch repo remote to SSH (on server)

Inside your project:

git remote set-url origin git@github.com:semantic-software/emblem-ergani.git


5. Test authentication

ssh -T git@github.com

You should see:

Hi semantic-software! You've successfully authenticated...


6. Now automation works (no password ever)

git pull origin main


🤖 Automate it (cron / deploy hook)

Example cron (pull every minute)

crontab -e

* * * * * cd /var/www/emblem-ergani && git pull origin main

Revision #1
Created 2026-05-28 10:31:10 UTC by Admin
Updated 2026-05-28 10:31:22 UTC by Admin