Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GitHub Git Pull — WordPress Plugin

Pull from a GitHub repository directly from the WordPress admin dashboard.


Installation

  1. Upload the github-git-pull folder to /wp-content/plugins/
  2. Activate the plugin via Plugins → Installed Plugins
  3. Go to Git Pull → Settings in the admin sidebar

Configuration

SettingDescription
Repository PathAbsolute path on the server to the directory containing .git (e.g. /var/www/html)
BranchBranch to pull from (default: main)
RemoteGit remote name (default: origin)
Git Binary PathFull path to git — run which git on your server
SSH Key PathOptional — path to SSH private key if using SSH remotes

Lightsail Setup (SSH Authentication — Recommended)

# 1. Generate a deploy key for the www-data user
sudo -u www-data ssh-keygen -t ed25519 -C "lightsail-deploy" -f /var/www/.ssh/id_ed25519 -N ""# 2. Print the public key — add this to GitHub repo → Settings → Deploy keys
sudo cat /var/www/.ssh/id_ed25519.pub
# 3. Fix permissions
sudo chown -R www-data:www-data /var/www/.ssh
sudo chmod 700 /var/www/.ssh
sudo chmod 600 /var/www/.ssh/id_ed25519
# 4. Test the connection as www-data
sudo -u www-data git -C /var/www/html pull origin main

Set SSH Key Path in the plugin settings to /var/www/.ssh/id_ed25519.


HTTPS Authentication (Personal Access Token)

Update your git remote to embed the token:

cd /var/www/html
git remote set-url origin https://<YOUR_TOKEN>@github.com/<user>/<repo>.git

Leave SSH Key Path blank in settings.


Server Requirements

  • PHP exec() must be enabled (not disabled in php.ini)
  • The web server user (www-data / apache) must have write access to the repo directory
  • git must be installed on the server (sudo apt install git)

Troubleshooting

ProblemFix
git binary not foundRun which git and update the Git Binary Path setting
Permission deniedCheck that www-data owns the .git directory
Host key verification failedThe SSH key path is set and the key is added to GitHub
exec() disabledContact host or check php.ini for disable_functions

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages