For a whole site, wp-content, one plugin or one theme. Runs in your browser. Nothing you type leaves the page.
Pick what your repository holds and get a .gitignore that keeps WordPress core, uploads, caches and secrets out of Git, and keeps your own code in.
# .gitignore for a whole WordPress site (repo root = the folder with wp-config.php) # Made with https://wppusher.com/tools/gitignore/ # WordPress core: WordPress installs and updates it, so keep it out of Git /wp-admin/ /wp-includes/ /index.php /license.txt /readme.html /xmlrpc.php /wp-*.php # Config and secrets that differ per server /wp-config.php /.htaccess /.user.ini /wordfence-waf.php .env .env.* !.env.example auth.json # Uploads and files WordPress generates /wp-content/uploads/ /wp-content/upgrade/ /wp-content/upgrade-temp-backup/ /wp-content/fonts/ /wp-content/languages/ # Caches and the drop-ins caching plugins write /wp-content/cache/ /wp-content/et-cache/ /wp-content/litespeed/ /wp-content/w3tc-config/ /wp-content/wp-rocket-config/ /wp-content/advanced-cache.php /wp-content/object-cache.php /wp-content/wp-cache-config.php # Backups, security logs and database dumps /wp-content/ai1wm-backups/ /wp-content/updraft/ /wp-content/backups-dup-lite/ /wp-content/wflogs/ *.sql *.sql.gz # Dependencies node_modules/ # Logs *.log # OS and editor files .DS_Store ._* Thumbs.db Desktop.ini .idea/ .vscode/ *.swp *~
Before you commit
A .gitignore only stops new files from being added. If wp-config.php or uploads/ is already in the repo, remove it from the index (the files stay on disk):
git rm -r --cached wp-config.php wp-content/uploads
If a secret was ever committed, change it. It's still in the history.
git check-ignore -v path/to/file prints the rule that matches, or nothing if the file is tracked. git status --ignored lists everything being ignored.
The whole-site file ignores .htaccess because WordPress rewrites it. Delete that line if you hand-edit it. languages/ is ignored because WordPress downloads translations. Delete that line if you ship your own.
Then deploy it
WP Pusher installs a plugin or theme straight from GitHub, Bitbucket or GitLab and updates it when you push. It runs inside WordPress, so the server needs no Git and no SSH. It deploys plugins and themes, not WordPress core, which is the same line this file draws.
Take the pain out of WordPress development. Push your code to GitHub where it belongs and never again deploy files over FTP on cheap shared hosting.