Using Git for version control
Git lets you track code changes and deploy your website from a repository. On Dirham A Day hosting you can use Git over SSH.
Clone a repository to your hosting:
- Enable SSH access in the DirhamHost panel and connect via
ssh username@yourdomain.ae. - Navigate to where you want the code:
cd public_html. - Clone your repo:
git clone https://github.com/you/your-repo.git .
Deploy updates: from the server run git pull to fetch the latest changes. You can automate this with a cron job or a deployment webhook script.
Tips:
- Use an SSH deploy key for private repositories rather than a password.
- Keep secrets (like
wp-config.phpor.env) out of Git using a.gitignore. - Do not expose the
.gitfolder publicly - add a rule in.htaccessto deny access to/.git.
For a professional workflow, keep public_html as your deployment target and develop locally, pushing to GitHub or GitLab and pulling on the server. If you prefer, some panels offer a built-in Git deployment feature - check under version control tools. Our team can help set up a deploy key or pull script - WhatsApp +971 58 553 6767.
Still need a hand? Our UAE-based team is here 24/7.