简体   繁体   中英

How to handle upload folder in git & wordpress devlopment workflow

I am currently learning use git & wordpress development workflow:

  1. develop the wp site locally in mamp enviroment;
  2. push the local wp repo to the remote repo in my serve;
  3. use git hook to automatically push the repo in my server to server site folder;

but there is a problem in this workflow, if the user upload a file in my live site, the server repo could not push to the live server, as I have to stash those "avatar files" through ssh.

My need is to push my local site to remote server and every will be merger automatically.

How could I do that?

btw, this is my gitignore file :

*.log
.htaccess
/local-config.php
/sql-dump-*.sql
/wp-content/cache/*
.DS_Store
/shared/content/uploads/wp-sync-db
/wp-content/advanced-cache.php
/wp-content/wp-cache-config.php
/wp-content/backup-db/
/wp-content/backups/
/wp-content/upgrade/
/wp-content/cache/
sitemap.xml
sitemap.xml.gz
Thumbs.db
[http] 
    postBuffer = 524288000

sorry about my English, hope I make things clear...

Updating your index should solve the issue. Docs here .

git update-index --assume-unchanged  uploads/user-uploaded-content

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM